Question: Create a class Student with public member variables: Student name, student number, contact number, ID number. The following specifications are required: Add init() method of
Create a class Student with public member variables: Student name, student number, contact number, ID number. The following specifications are required:
Add init() method of the class that initializes string member variables to empty strings and numeric values to 0.
Add the method populate() to the class. The method is used to assign values to the member variables of the class.
Add the method display() to the class. The method is used to display the member variables of the class.
Create an instance StudentObj of the class Student in a main program.
The main program should prompt the user to enter values for five students. The attributes should be assigned to the instance of Student using its populate() method, and must be displayed using the display() method of the instance of Student.
Step by Step Solution
3.44 Rating (157 Votes )
There are 3 Steps involved in it
Certainly Well go through the process of creating the class Student as well as implementing its methods and using it in the main program Step 1 Define ... View full answer
Get step-by-step solutions from verified subject matter experts
