JAVA QUESTION: Suppose that you are writing a class named Student. It has three
ID: 3767376 • Letter: J
Question
JAVA QUESTION:
Suppose that you are writing a class named Student. It has three private attributes: int id; String name; and double gpa; Write a constructor with three arguments for this Student class. For same Student class in Problem 1, write set and get method for attribute gpa. For same Student class in Problem 1, write one line of code to create a Student object named student 1. Student 1's name is "John Doe"; id is 1234; and gpa is 3.92 Write one line of code to display a message "Thank You!". You must use method in JOptionPane class to do so. Write one line of code to make the JTextFiled displayField cannot be typed in. For same Student class in Problem 1, override equals method inherited from Object class. Two Student objects are equal if they have the same id. Suppose that you have a class Employee, which has three private attributes: String id; String name; and String address; Suppose class HourlyEmployee is a child class of Employee. HourlyEmployee has an attribute double wage; Write the header of HourlyEmployee class. Write necessary mutator and accessor methods for HourlyEmployee classExplanation / Answer
2.public class Student
{
private string name;
private int Id;
private double gpa;
public Student(double gpa)
{
gpa = 0.0;
}
public double getGpa()
{
return gpa;
}
public void setGpa(Double gpa)
{
doubleGpa= gpa;
}
public double gpa()
{
return gpa;
}
3. class student
{
string name="John Doe";
int id=1234;
double gpa=3.92;
}
public void main(String args[])
{
student student1= new student1()
student1.name();
student1.id();
student1.gpa();
}
4.Joptionpane.ShowMessageDialog("Thank You!");
5. item2 = new JTextField( );
6. public class MyClass
{
private final String importantField;
7.(a&b)
public class HourlyEmployee extends Employee
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.