StudentClass
Create a class named Student that has three member variables:
- name - A string for the name of the student.
- numClasses - An integer for how many courses the student is currently enrolled in.
- classList - An array of strings for the names of the classes the student is enrolled in.
Write appropriate constructor(s), mutator (set), and accessor (get) methods for the class along with the following:
- A function that inputs all values from the user, including the list of class names.
- A function that outputs the name and list of all courses.
- A function that r e s e t s the number of classes to 0 and the classList to an empty array
(with null strings).
The main() should test all of these functions. It should perform the following steps in a loop: • It should ask the user to input a student's data.
- Display the entered data back (in a well-formatted way).
1
- Ask the user if they want to enter the data again (y/n).
- If 'n', then the program ends, otherwise it should clear the student class object and
repeat the loop (ask the user to enter new data...).
Note: The statement 'cin >> variable;' leaves a newline character in the buffer. This can be a problem if you are mixing 'cin >> variable;' and the 'getline' function (that reads a line of input). Use 'cin.ignore' function to discard the newline character after using 'cin'.
Filename: student.cpp
please write comments if possible and make simple if possible.