Question: //What's wrong with my code? int run() { // Don't change anything inside this function printTitle(); string letterGrade = getInput(); double points = letterToPoints(letterGrade); printReport(points);
//What's wrong with my code?

int run() { // Don't change anything inside this function printTitle(); string letterGrade = getInput(); double points = letterToPoints(letterGrade); printReport(points);
return 0; }
// Implement your functions here
void printTitle() { cout > gradeIn;
return gradeIn; } double letterToPoints(stringIn letterGrade) { double gradePoints = -1;
if (gradeIn == "A") gradePoints = 4.0; else if (gradeIn == "A-") gradePoints = 3.7; else if (gradeIn == "B+") gradePoints = 3.3; else if (gradeIn == "B") gradePoints = 3.0; else if (gradeIn == "B-") gradePoints = 2.7; else if (gradeIn == "C+") gradePoints = 2.3; else if (gradeIn == "C") gradePoints = 2.0; else if (gradeIn == "C-") gradePoints = 1.7; else if (gradeIn == "D+") gradePoints = 1.3; else if (gradeIn == "D") gradePoints = 1.0; else if (gradeIn == "D-") gradePoints = 0.7; else if (gradeIn == "F") gradePoints = 0.0; return 0.0; } void printReport(double points) { cout = 0) { cout = 1 && gradeIn.at(0) != 'A' && gradeIn.at(0) != 'B' && gradeIn.at(0) != 'C' && gradeIn.at(0) != 'D' && gradeIn.at(0) != 'F') { errorMessage = "INVALID LETTER GRADE"; } else { errorMessage= "Invalid Input" ; } } 

Letter grades are A B C D and F, possibly followed by + or - Their nu- meric values are 4, 3, 2, 1 and O. In our scheme, there is no F+ or F-, or Ar. Adding a + to the grade increases the numeric value by 0.3, a-de- creases it by 0.3. int run() { // Don't change anything inside this function printTitle(); string letterGrade = getInput(); double points - letterToPoints(letterGrade): printReport(points); return 0; 40 // Implement your functions here 45 42 void printTitle) 43 { cout > gradeIn; return gradeIn; 56 double letterToPoints (stringin letterGrade) double gradePoints = -1; if (gradeIn == "A") gradePoints = 4.0; else if (gradeIn == "A-") gradePoints = 3.7; else if (grade In == "B+") gradePoints = 3.3; else if (gradeIn == "B") gradePoints = 3.0; else if (grade In == "B-") gradePoints = 2.7; else if (grade In == "C+") gradePoints = 2.3; else if (grade In == "C") gradePoints = 2.0; else if (gradeIn == "C-") gradePoints = 1.7; else if (gradeIn == "D+") gradePoints = 1.3; else if (gradeIn == "D") gradePoints = 1.0; if (grade In == "A") gradePoints = 4.0; else if (gradeIn == "A-") gradePoints = 3.7; else if (grade In == "B+") gradePoints = 3.3; else if (grade In == "B") gradePoints = 3.0; se if (grade In == "B-") gradePoints = 2.7; else if (grade In == "C+") gradePoints = 2.3; se if (gradeIn == "C") gradePoints = 2.0; else if (gradeIn == "C-") gradePoints = 1.7; else if (gradeIn == "D+") gradePoints = 1.3; else if (gradeIn == "D") gradePoints = 1.0; else if (gradeIn == "D-") gradePoints = 0.7; else if (gradeIn == "F") gradePoints = 0.0; return 0.0; 74 void printReport(double points) 75 { cout = 0) cout = 1 && gradeIn.at() != 'A' && gradeIn.at() != 'B' && gradeIn.at(0) != 'C' && gradeIn.at(0) != 'D' && gradeIn.at(0) != 'F) errorMessage = "INVALID LETTER GRADE"; else errorMessage= "Invalid Input" ; 24:1 C and C++ Tabs: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
