Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program calculates a product of two numbers without using assembly instruction for multiplication (e.g., mult). When your program starts, your program prompts a user

image text in transcribed
This program calculates a product of two numbers without using assembly instruction for multiplication (e.g., "mult"). When your program starts, your program prompts a user to enter two numbers (each number should be larger than 0 and less than 50). The product of two numbers should be calculated by adding the first number as many times as the second number. When a user enters any invalid number, your program should detect it and repeat the prompt to a user Enter the first number (0-50): 60 The number entered is not in 0-50. Eneter another number. Enter the first number (0-50): -16 The number entered is not in 0-50. Eneter another number. Enter the first number (0-50): 20 Enter the second number (0-50): 78 The number entered is not in 0-50. Eneter another number. Enter the second number (0-50): -6 The number entered is not in 0-50. Eneter another number. Enter the second number (0-50): 30 600 a. The above program should be implemented using a loop structure implemented in MIPS "add" assembly instructions, but not using any multiplication instruction. b. Each input must be tested to confirm it is a valid input. c. If an input number is less than 0, display an error message, "the entered number is less than 0". Then, prompt a user to make another input. d. If an input number is larger than 50, display an error message, "the entered number is larger than 50". Then, prompt a user to make another input. e. After the first input is correctly made, the first input should never be repeated when a user makes an invalid input for the second input. f. Your program should correctly calculate the product of the two numbers by using only instruction for addition (no multiplication). g. Your program should terminate without any error or a warning message

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

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

Understand how to design effective service guarantees.

Answered: 1 week ago

Question

Know when firms should not offer service guarantees.

Answered: 1 week ago