Question: 15. (10 marks) Write the student class that includes the followings. .Three instance variables for age, gpa, and name. (They should not be directly accessed
15. (10 marks) Write the student class that includes the followings. .Three instance variables for age, gpa, and name. (They should not be directly accessed through a Student object.) .Constructor that accepts age, gpa, and name, and initializes the above three instance variables. .A method getGpa that returns the gpa. .A method setAge that accepts age and sets the instance variable age. A method getName that returns the name. A method tostring that returns a string of the description of the Student object. turns a string of the description of the student object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
