Write a short MARIE program. Answer ASAP. Will upvote.
This program will let the user input two decimal values a and b. Then this program will calculate c = a + b and output the result.
Q1) Write down the code which let the user input two valuesa and b. The code need to store the input values.
Q2) Write down the code which calculates c = a + b. The code need to store the result into variable c.
Q3) Write down the code which output the variable c. The code need to load the variable c first.
Q4) Write down the code which output the variable c. The code need to load the variable c first.
input / input value from keuboard in accumulator (AC)
store a / store value in AC in variable a
input / input value from keuboard in accumulator (AC)
store b / store value in AC in variable b
load a / load value of variable a to AC
add b / add value of variable b to value in AC
store c / store value in AC, which is now a+b, in variable c
load c / load value of variable c to AC
output /output the value in AC (currently c) to the display
halt /terminate program
Get Answers For Free
Most questions answered within 1 hours.