Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a simple integer calculator using the MARIE computer. The program should execute as follows: 1 . Using the INPUT instruction wait for the user

Create a simple integer calculator using the MARIE computer.
The program should execute as follows:
1
.
Using the INPUT instruction wait for the user to enter a decimal number.
2
.
Using the INPUT instruction wait for the user to enter the operator as the ASCII
character
+
,
-
or
*
.
3
.
Using the INPUT instruction wait for the user to enter a second decimal number.
4
.
Perform the desired addition, subtraction, multiplication, or division operation.
5
.
Store the result in a variable in memory.
6
.
Display the result via the OUTPUT instruction.
7
.
If an invalid operation is requested, display a zero as the result.
8
.
The code should be clearly commented.
The multiply can be done by repeated additions. For example,
1
2
*
3
would be
calculated as
1
2
+
1
2
+
1
2
.
You need to support a negative multiplier and negative multiplicand
(
1
2
*
-
3
)
.
Implement divide by allowing the user to enter
/
.
Only positive numbers need to be supported. Both the resulting quotient and remainder need to be displayed. The divide can be done by repeated subtractions.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions