Question: Define a class named Student with private data members to store a student name and GPA, and public getters and setters for the private variables.

Define a class named Student with private data members to store a student name and GPA, and public getters and setters for the private variables.

In the main function, instantiate a student object and prompt the user for a student name and GPA. (You will need local variables in the main function.)

Use your setters to populate the name and GPA of your student object. Use your getters to display the name and GPA of your student object.

Sample output:

Enter student name: Brad Enter student GPA: 3.9 Student name is Brad and GPA is 3.9

C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!