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:: tostring 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 tostring endl;
Your program shall generate the following output. Note the returned string from the tostring 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
Overall, they earned out of points.
void Student: :updatelabunsigned 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:
;
cout tring endl;
Your program shall generate the following output:
The student's name is Unknown; thetr lab grades are:
table
Overall, they earned out of points.
If an invalid pos andor invalid grade are provided for the function, no change shall be made to the labsarray. Instead, the function shall display a message explaining why the update is not successful. A lab grade should be an integer from to inclusive.
void Student: :updatelabs const string grades;
This mutator function is to update all the elements of the labsarray 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 to 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 updatelabs and tostring:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
