Question: This is worth up to six ( 6 ) points extra credit. Consider the following fragment of main and function called letterGrade ( ) .
This is worth up to six points extra credit. Consider the following fragment of main and function called letterGrade Assume all other code is correctly defined so that these work. Convert the given code to handle an exception, in which the function throws an exception if the passedin grade is below assumed on a point scale The section in main should contain the try and catch blocks, and the function should add a correctly written throw statement. Have the catch print a message that says the specific is too low to report a letter grade include the actual value that caused the throw
string letterGradefloat grade
if grade return A;
else if grade return A;
else if grade return B;
other options omitted for brevity
int main
float grade;
cout "What is the score, to ;
cin grade;
string lgrade letterGradegrade;
cout "The grade was a lgrade endl;
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
