Question: C++ CODE Write a program that uses a Student class with the following member variables and member functions: Private member variables Type Member name Description
C++ CODE



Write a program that uses a Student class with the following member variables and member functions: Private member variables Type Member name Description name Student name string idNuma int Student ID number GPA double GPA Public member functions Mutators setName: Takes as argument the student's name as a string and sets the name member variable to that string setldNum: Takes as argument the student's ld number as an int and sets the ldnum member variable to that value. Performs input validation f the parameter value is not 0, displays "Invalid ld number" error message and exits the program. setGPA: Takes as argument the student's GPA as a double and sets the GPA member variable to that value. Performs input validation: If the GPA value is not in the range from 0 to 4 inclusive, displays "invalid GPA" error message and exits the program. Accessors getName: returns the name getldNum: returns the ldnum getGPA: returns the GPA The program should ask the user how many students there are. It should then dynamically allocate an array of Student. After the array has been dynamically allocated, the program should ask for the name, ID number and GPA for each student and populate the array. Then the content of the array is displayed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
