99 768
Assignments Done
98.5%
Successfully Done
In May 2021

# Answer to Question #26278 in C++ for red rose

Question #26278
the following if-else chain into a full C++ program using a switch statement:

#include &lt;iostream&gt;

using namespace std;

int main()

{

cout &lt;&lt; &quot;Enter the grade: &quot;;

cout&lt;&lt;&rdquo;The numerical grade is between 90 and 100\n&rdquo;;

cout&lt;&lt;&rdquo;The numerical grade is between 80 and 89.9\n&rdquo;;

cout&lt;&lt;&rdquo;the numerical grade is between 70 and 79.9\n&rdquo;;

cout&lt;&lt;&rdquo;How are you going to explain this one\n&rdquo;;

else

{

cout&lt;&lt;&rdquo;It must have been the professor&rsquo;s fault.\n&rdquo;;

}

return 0;

}
1
2013-03-12T11:58:42-0400
#include <iostream>

using namespace std;

int main()
{

cout << "Enter the grade: ";

{
case 'A':
& cout<<"The numerical grade is between 90 and 100\n";
& break;

case 'B':
& cout<<"The numerical grade is between 80 and 89.9\n";
& break;

case 'C':
& cout<<"the numerical grade is between 70 and 79.9\n";
& break;

case 'D':
& cout<<"How are you going to explain this one\n";
& break;

default:
& cout<<"It must have been the professor's fault.\n";
}

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!