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.
Create a simple integer calculator using the MARIE computer. ***Clear and descriptive comments on code*** The program sh
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am