Question
Create a MIPS program that fulfills the following specifications: in the .data section: 3 variables to hold input values: a, b, c 3 variables to
Create a MIPS program that fulfills the following specifications:
in the .data section:
3 variables to hold input values: a, b, c
3 variables to hold output values (name them whatever you like)
a variable to hold the users name
3 variables for messages:
A prompt for name
A prompt for integers
A message for results (similar to the sample run below)
in the .text section write instructions to:
prompt the user for their name and save it in memory
3 times:
prompt user for an integer between 1-100
read and store the integers in a, b, and c
no input checking required
calculate ans1 = a + b + c and store the result
calculate ans2 = c + b - a and store the result
calculate ans3 = (a + 2) + (b - 5) - (c 1) and store the result
display the user name and message for results
display the 3 results but print a space character in between for readability
at the bottom of your program, add comments with test values for a, b, c and the results you expect from the program for ans1, ans2, ans3 (see sample run below)
Sample Runs: (you should use different test data) Notice that printing the name string causes a newline, but don't worry about it What is your name? Karen Please enter an integer between 1-100: 7 Please enter an integer between 1-100: 17 Please enter an integer between 1-100: 27 Karen your answers are: 51 37 -5 program is finished running What is your name? Karen Please enter an integer between 1-100: 20 Please enter an integer between 1-100: 360 Please enter an integer between 1-100: 40 Karen your answers are: 90 50 8 program is finished runningStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started