Question: Write a LMC program that converts an Unreal number into a decimal number. The Unreal number system is like the Roman number system; however, it

Write a LMC program that converts an Unreal number into a decimal number. The Unreal number system is like the Roman number system; however, it has some exceptions and limitations. You must display the result as output before halting the program.
For example, the Unreal number CXI is 111, and XXXVI is 36.
Unreal digit Natural number
I 1
V 5
X 10
L 50
C 100
D 500
Your program only needs to support the Unreal digits listed in the table above.
Your program will only be able to calculate a natural number up to and including 999.
If the user enters an Unreal numeral which exceeds this, the output is to be 999.
Six (6) input values are provided by the user, the order of input is important:
The first input is the number of Ds that the Unreal number contains.
The second input is the number of Cs that the Unreal number contains.
The last input is the number of Is that the Unreal number contains.
For example, if the user provides the inputs 0,0,0,1,2,2 then this will be the equivalent of XVVII
Describe your approach to solving the problem.
Use natural language, structured like a conventional programming language to communicate your design.
When necessary, use looping and conditional constructs.
Name symbols sensibly to make their use clear.
Cormen (2009) wrote an excellent introduction to the conventions of pseudocode (see Part I, chapter 2, section 1.2). You can read this by searching for the text via QUT Library.
Cormen, Thomas H. Leiserson, Charles E. Rivest, Ronald L. Stein Clifford. (2009). Introduction to Algorithms (3rd Edition)-2.1.2 Pseudocode Conventions. MIT PressDraft a test plan to be used as a verification method to ensure that your LMC program is correct.
Tabularise test input value(s) and the expected output(s)
Consider uncommon cases. For example, when the calculator reaches its maximum value, when negative values are calculated, or when an input is unexpectedly large.
Draft your test plan using the following template (two examples are provided):
Comma-separate the input and output values.
Delete the examples.
Input Value(s) Expected output value(s) Notes
2,4,610 All even numbers
1,3,59 All odd numbers
Implement an LMC program according to the algorithm you designed in Q1.
Use the test suite you designed in Q2 to verify the implementation of your algorithm is correct.
Only symbolic addressing is to be used; numerical addressing will be disabled.
LMC program must request the correct number of input(s).
LMC program must produce the correct number of output(s).
LMC program must produce the correct output value(s) for all given test cases.
Code must be tidy (spacing, indentation) and comments are to be used to describe the algorithm. Do not describe the function of each LMC instruction.
Your LMC file should show the full history of how your solution was implemented.
Use LMC IDE v1.5.0.0(or greater)
Enter your student ID in the LMC IDE when completing this question
Errors will not be fixed by the marker.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!