Question: ( A ) You have a class Student according to the following: The class Student has the following instance variables: name ( String ) ,
A You have a class Student according to the following:
The class Student has the following instance variables:
name String
id int and
gpa double
Moreover, it has a class variable noOfStudents int which represent the total number of students in
UOB.
The class has the following methods:
accessors getters methods for each instance variable
An additional static getter method to get noOfStudents.
A mutator setter method to set the values of each of the instance variables.
A method displayStudentDetails to display on the screen all the student's details as in the
following sample:
B Define the class Student
a Include all the data members and methods described in part A
b Additionally, define a default constructor for the class that initializes name to No name yet.", id
to and gpa to Do not forget to update the value of the class variable noOfStudents in the
constructor.
C Write a Java application that:
Asks the user to enter hisher name, id and pga.
Create an object of Student class type and set its data members' values using the input data.
Display the student details by calling the displayStudentDetails method.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
