Question: string Student:: to _ string ( ) const, This accessor function is to return a string that contains a summary of the invoking student object.

string Student:: to_string() const,
This accessor function is to return a string that contains a summary of the invoking student object. For example, given the following code segment:
Student a;
cout a. to_string() endl;
Your program shall generate the following output. Note the returned string from the to_string function includes the following about the invoking Student object: name, subjective and possessive pronoun, the ten lab grades in two rows, and total earned points for the labs.
The student's name is Unknowm; thetr lab grades are:
\table[[-,0,0,0,0],[0,0,0,0,]]
Overall, they earned out of 100 points.
void Student: :update_lab(unsigned pos, unsigned grade):
This mutator function is to update a specific lab's grade for the invoking Student object. It takes two unsigned parameters pos and grade that represent the index of the speciflc lab to update and the new grade for that lab, respectively.
For example, given the following code segment:
a.updatelab(1,5);
cout a.tostring() endl;
Your program shall generate the following output:
The student's name is Unknown; thetr lab grades are:
\table[[0,5,0,0,0],[0,0,0,0,0]]
Overall, they earned 5 out of 100 points.
If an invalid pos and/or invalid grade are provided for the function, no change shall be made to the labs_array. Instead, the function shall display a message explaining why the update is not successful. A lab grade should be an integer from 0 to 10 inclusive.
void Student: :update_labs (const string grades);
This mutator function is to update all the elements of the labs_array for the invoking Student object. It takes a string grades that contains ten integers separated by commas. You may assume that each integer represents a lab grade from 0 to 10. The function parses the string grades using string stream and assigns the first integer to the first lab grade, the second integer to the second lab grade and so on. For example, given the following call to update_labs and to_string:
 string Student:: to_string() const, This accessor function is to return a

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!