Create a simple integer calculator using the MARIE computer. ***Clear and descriptive comments on code*** The program sh

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create a simple integer calculator using the MARIE computer. ***Clear and descriptive comments on code*** The program sh

Post by answerhappygod »

Create a simple integer calculator using the MARIE computer.
***Clear and descriptive comments oncode***
The program should execute as follows:
Using the INPUT instruction wait for the user to enter a decimalnumber.
Using the INPUT instruction wait for the user to enter a seconddecimal number.
Using the INPUT instruction wait for the user to enter theoperator as the character +, - or *.
Perform the desired addition, subtraction, or multiplicationoperation.
Store the result in a variable in memory.
Display the result via the OUTPUT instruction.
If an invalid operation is requested, display a zero as theresult.
The code should be clearly commented.
Submit your .MAS file to the Project 1 dropbox.
The multiply can be done by repeated additions. For example, 12* 3 would be calculated as 12 + 12 + 12. You need to support anegative multiplier and negative multiplicand (12* -3).
Bonus – 10 points
Implement divide by allowing the user to enter /. Only positivenumbers need to be supported. Both the resulting quotient andremainder need to be displayed. The divide can be done by repeatedsubstructions.
Grading Criteria:
-15 points if not all operations are supported.
-5 points if your code is not commented nicely.
-5 points if there is no error checking for an unrecognizedoperator.
-10 points if the arithmetic results are not correct.
-10 points if multiply with a negative number fails.
-10 points if three individual programs are submitted ratherthan one program that does all the operations.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply