Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started