subject
Engineering, 14.02.2020 23:30 teionamwhite2262

In your Lab assignment, you should have parsed the input expression from the keyboard, echoed it to the screen and called a subroutine with the input. In this MP you will write code to use a stack to
evaluate the expression. If the read value is an operand, push it onto the stack. If the read value is an operator, pop two values from the stack, apply the operator on the two values and push the result
back on the stack. Keep repeating this for every value read from keyboard and stop when you reach the ASCII value of the "=" (equal sign) character. If the last value is an operand, that means
the expression was invalid. If there is a stack underflow during any point in this process, then the expression was invalid. Do not worry about stack overflows. Look at the flowchart below for a detailed
description of the algorithm.
MP2 is due on Thursday, Sept. 21, by 10pm in your svn repository.
MP2_testcases. docx

For example if the input the user entered on the keyboard was "3 4 -=", then the stack through the evaluation of the expression will be-
Start Read "3"(push x0003) Read "4"(push x0004) Read "-"(pop, calculate and push)
x0000 x0000 x0000 x0000
x0000 x0000 x0004 x0000
x0000 x0003 x0003 x
Examples:
Input Solution in decimal (stored in R5 as binary) Hexadecimal Output on screen
4 5 + 3 * 7 -= 20 (0000000000010100) x0014
5 2 8 * + 3 -= 18 (0000000000010010) x0012
5 1 2 + 4 * + 3 -= 14 (0000000000001110) x000E

ansver
Answers: 2

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 03.07.2019 14:10
If the thermal strain developed in polyimide film during deposition is given as 0.0044. assume room temperature is kept at 17.3 c, and thermal coefficient of expansion for the film and the substrate are 54 x 10^-6c^-1 and 3.3 x 10^-6c^-1respectively. calculate the deposition temperature.
Answers: 3
question
Engineering, 04.07.2019 08:10
Which of the following is an easy way to remember the modified “x” tire rotation? a. nondrive wheels straight, cross the drive wheels b. drive wheels straight, cross the nondrive wheels c. drive wheels crossed, nondrive wheels straight d. drive wheels crossed, nondrive wheels crossed
Answers: 1
question
Engineering, 04.07.2019 18:10
Aflywheel accelerates for 5 seconds at 2 rad/s2 from a speed of 20 rpm. determine the total number of revolutions of the flywheel during the period of its acceleration. a.5.65 b.8.43 c. 723 d.6.86
Answers: 2
You know the right answer?
In your Lab assignment, you should have parsed the input expression from the keyboard, echoed it to...
Questions
question
Biology, 29.11.2019 17:31
question
Mathematics, 29.11.2019 17:31
Questions on the website: 13722367