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

Write a switch statement that checks origLetter. If \'a\' or \'A\', print \"Alph

ID: 3562266 • Letter: W

Question

Write a switch statement that checks origLetter. If 'a' or 'A', print "Alpha". If 'b' or 'B', print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline.

Sample program:

Below, do not type an entire program. Only type the portion indicated by the above instructions (and if a sample program is shown above, only type the <STUDENT CODE> portion.)

i feel like i have an idea on how to do this but im still really confused. can someone please show me how to do this?

Explanation / Answer

// End with newline.

switch(origLetter)

{

case 'a' :

case 'A':

cout<<"alpha"<<endl;

break;

case 'b':

case 'B':

cout<<"beta"<<endl;

break;

default:

cout<<"not valid expression"<<endl;

}

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