Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE MAKE SURE: 1. To have a good read of the sections and all the details (three solutions provided with test suites are fully or

PLEASE MAKE SURE:

1. To have a good read of the sections and all the details (three solutions provided with test suites are fully or partially failing on LMC IDE).

2. IF YOU CAN'T PROVIDE A SCREENSHOT OF YOUR FUNCTIONAL TEST SUITE ON LMC IDE, THEN NO NEED TO PROVIDE YOUR SOLUTION. DON'T PROVIDE SOLUTIONS ON ANY OTHER CODING LANGUAGES E.G JAVA ETC.

3. Your solution MUST show all variables initialization at the end of your code e.g. SUM: DAT 00 (Don't cut anything out).

4. Aside from your written solution of all sections, upload a screenshot of a functional test suite (Zoon in if necessary) and the same of your entire code.

5. Use | or # for comments on the code.

6. Symbolic addressing is followed by a colon (:)

e.g. IsZero: LDA numD

image text in transcribed

image text in transcribed

image text in transcribed

Task: Write a Little Man Computer program that converts a given Little Man number into a number using the base-10 number system. The Little Man number system is similar to the Roman number system; however, it has some exceptions and limitations. You must display the result as an output before halting the program. For example, the LMC number CXI is 111 , and XXXVI is 36 . Output example Output example (2022) courtesy of QUT School of Computer Science Your program will only be able to calculate a natural number up to and including 999. If the user enters a Little Man numeral that exceeds this, the output is to be 999. Six input values are provided by the user and the order of input is important: - The first input is the number of Ds that the Little Man numeral contains. - The second input is the number of Cs that the Little Man numeral contains. - The last input is the number of is that the Little Man numeral contains. For example, if the user provides the inputs 0,0,0,1,2,2, then this will be the equivalent of XVVII. 1.1. Write a pseudocode to describe your algorithm to solve the task: - Describe the algorithm using natural language, structured using the convention of normal programming language. - When necessary, use looping and conditional constructs. - Name the symbols (variables) sensibly to make their use clear. Hint: For an excellent introduction to pseudocode conventions, see Cormen et al. (2009, pp. 20-22). 1.2. On the template provided, draft 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, such as when the calculator reaches its maximum value, when negative values are calculated, or when an input provided is unexpectedly large. Hint: an example test plan is provided for your reference. 1.3. Implement an LMC program according to the algorithm you designed in 1.1. Use the test suite you designed in 1.2 to verify that the implementation of your algorithm is correct. Use symbolic addressing only, numerical addressing will be disabled. Your LMC program: - must request the correct number of input(s) - must produce the correct number of output(s) - must produce the correct output value(s) for all given test cases. Ensure that your code is tidy (spacing, indentation) and that you include comments 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. Hint: The HLT command must be executed. Make sure to check that it is not missing or that you do not have syntax or run-time errors

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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

Explain the basic functioning of K-means clustering.

Answered: 1 week ago