Question: 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
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
Get step-by-step solutions from verified subject matter experts
