Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Rewrite the following using a switch statement. Code and submit the program (inc

ID: 3640018 • Letter: R

Question

Rewrite the following using a switch statement.
Code and submit the program (including at least 2 outputs) to the Wk10_Assign3 DropBox


#include<iostream.h>
int main ( )
{
char marcode;
cout<< “Enter a time of day code: “;
cin >> timeofday;

if (timeofday = = ‘M’)
cout << “Good Morning!” << endl;

else if (timeofday = = ‘A’)
cout << “Good Afternoon” << endl;

else if (timeofday = = ‘E’)
cout <<”Good Evening” << endl;

else if (timeofday = = ‘N’)
cout << Good Night” << endl;

else
cout << “An invalid code has been entered. Please Try Again!!”

return 0;
}


Explanation / Answer

#include int main ( ) { char marcode; cout> timeofday; switch(marcode) { case M : cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote