Question: Modify this C++ program to use if/else if/else statements instead of a switch statement Remember Indentation (at least 4 spaces) within each block is expected.

Modify this C++ program to use if/else if/else statements instead of a switch statement Remember Indentation (at least 4 spaces) within each block is expected. All statements within a block should be aligned. Use appropriate spacing. #include using namespace std; int main() { //declare variables char grade; //prompt for user inputs cout << "What grade did you earn in Programming I ? "; cin >> grade; //display results switch (grade) // This is where the switch statement begins { case 'A': cout << "an A - excellent work !" << endl; case 'B': cout << "you got a B - good job" << endl; case 'C': cout << "earning a C is satisfactory" << endl; case 'D': cout << "while D is passing, there is a problem" << endl; case 'F': cout << "you failed - better luck next time" << endl; default: cout << "You did not enter an A, B, C, D, or F" << endl; } //end switch return 0; } //end main()

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!