Write a class called student that will keep track of a


Write a class called Student that will keep track of a student and a grade.

The class should have a constructor that takes a first name, last name and a grade (double)
The class should have a getFirstName, getLastName and getGrade methods
The class should have a getName that returns the first name, a space and the last name
The actual firstName, lastName and grade fields should be private:
Here is the main:
void main(){

Student s("Rob", "Hampton", 85.5);
cout << s.getName() << endl; // should output "Rob Hampton"
Student x("Tom", "Smith", 90);
cout << x.getLastName() << ", " << x.getFirstName() << " " << x.getGrade() << endl;
// should output "Smith, Tom 90"
}

 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a class called student that will keep track of a
Reference No:- TGS0661028

Expected delivery within 24 Hours