Question
Translate the program below into PEP/8 assembly language Use a jump table to implement the switch statement. Use trace tags on all variables. For invalid
Translate the program below into PEP/8 assembly language Use a jump table to implement the switch statement. Use trace tags on all variables. For invalid scores, output should be the same as the C++ program. Add something to the output that makes this program uniquely yours. The variable finish needs to be local. This is similar to Fig 6.40. a) Comment lines of the source code to trace the C++ code. Cut & paste the Source Code Listing into your assignment document. b) Run for each score and paste a screen shot of each of the PEP/8 Output area. c) Step thru & Cut and paste the memory trace at any point.
C++ Code
#include
int main ()
{ int finish;
cout << "Enter your score: 1, 2, 3, 4, or 5" << endl; cin >> finish; switch (finish)
{
case 1: cout << "You win!" << endl;
break; case 2: cout << "You place!" << endl;
break; case 3: cout << "You show!" << endl;
break; case 4:
cout << "You didn't even show" << endl; break; default:
cout << "You weren't even competing" << endl;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started