Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write LMC programs to complete the following tasks. You may need to use the BRZ, BRP and BR commands here as well. For each task

Write LMC programs to complete the following tasks. You may need to use the BRZ, BRP and BR commands here as well. For each task you should submit annotated mnemonics:

  1. Ask the user for two numbers and multiply the two numbers and print out the product.
  2. Ask the user for two numbers and divide them and print out the quotient and the remainder.
  3. Ask the user for two numbers and print out the biggest.

For example: Test data: 7, 9; Expected output: 9

Test data: 9, 7; Expected output: 9

  1. Ask the user for two numbers. If they are the same then print 0, otherwise add them and print out the answer.

For example:

Test data: 3, 9; Expected output: 12

Test data: 7, 7; Expected output: 0

  1. Ask the user for one larger number and one factor of that number (e.g. 15 and 3, 20 and 5). The program should keep subtracting the smaller number until it reaches 0 - where it should print out 0.

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions