IFN551 Computer Systems Fundamentals
Assignment B
Weighting: 20%
Due 21April 2022 by 11:59pm Individual submission via QUT Blackboard only
Use Little Monkey Computer v1.4.0.0 (or greater)
AssignmentTutorOnline
Enter your student ID in the LMC Interpreter when completing this assessment item.
Failing to include the .lmc file in your submission will result in a grade of zero for Q1.4
Sufficient LMC file history must be available to demonstrate authenticity.
Please submit Question 1.1, 1.2 and 1.3 using the template provided on Blackboard. Please submit your LMC file for Question 1.4 directly to Blackboard.
Task 1
Write a Little Monkey Computer program that converts a Monkey number into a number using the base-10 number system. The Monkey number system is similar to the Roman number system, however, it has some exceptions and some limitations. You must display the result as output before halting the program.
For example, the Monkey number CXI is 111, and XXXVI is 36.
Roman numeral | Natural number |
I | 1 |
V | 5 |
X | 10 |
L | 50 |
C | 100 |
D | 500 |
Your program only needs to support the Monkey numerals 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 a Monkey 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 D’s that the Monkey numeral contains.
The second input is the number of C’s that the Monkey numeral contains. The last input is the number of I’s that the Monkey numeral contains.
For example, if the user provides the inputs 0, 0, 0, 1, 2, 2 then this will be the equivalent of XVVII
Task 2
Write a Little Monkey Computer program that calculates the factorial of a number provided by the user. Display the result as output before halting the program, unless an error code is to be displayed. If the input value is greater than 6, then, the error code, 998, is displayed. If the user enters zero, then, the error code, 998, is displayed. Your program must not simply display pre-calculated values. For example:
Input value: 0 Result: 998
Input value: 7 Result: 998
Input value: 3 Result: 6
Question 1.1
Write pseudocode for task 1 and task 2 to describe your algorithm to solve the designated task.
Describe the algorithm using natural language, structured using the convention of a normal programming language.
When necessary, use looping and conditional constructs.
Name symbols (variables) sensibly to make their use clear.
Question 1.2
Draw a flowchart diagram for task 1 and task 2 to describe your algorithm to solve the designated task.
Draw your flowchart using Microsoft Office or an online tool like draw.io
You must use the correct symbols, as set by ANSI, when representing algorithmic constructs. Examples are provided in the tutorial slides.
It is recommended that you use a tool such as LucidChart, Draw.IO or the shapes in Office (PowerPoint is best at this).
Question1.3
Draft a test plan for task 1 and task 2 to be used as 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,6 | 10 | All even numbers |
1,3,5 | 9 | All odd numbers |
Question 1.4 (15 marks)
Implement an LMC program for task 1 and task 2 according to the algorithm you designed in Q1.1 and Q1.2.
Use the test suite you designed in Q1.3 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.
Note: A mark of zero will be given for those test cases where the HLT command is not executed. This may be due to it being missing or, syntax or run-time errors. Errors will not be fixed by the marker.
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA PhD. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS