Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a MIPS program that contains three subroutines which perform specific tasks based on the following requirements: 1 - A subroutine called display _ main
Write a MIPS program that contains three subroutines which perform specific tasks based on the following
requirements:
A subroutine called displaymainmenu that displays the main menu.
A subroutine called computeaseriesofnums that computes the series based on the end of series value entered
by the user. Note: The subroutine should deal with the numbers as double or float numbers and NOT INTEGERS!
Examples:
if a user inputs then the subroutine will compute this series of numbers: and return floatdouble
if a user inputs then the subroutine will compute this series of numbers: and return floatdouble
if a user inputs then the subroutine will compute this series of numbers: and return floatdouble
if a user input then the subroutine will compute this series of numbers: and return floatdouble
A subroutine called printarray that prints array elements. If the array is empty, the message "Array
is empty" should be displayed.
The main program will do the following:
a Display a menu to allow the user to choose any option and perform the corresponding actions. See below.
Menu:
Welcome to main menu!
Enter to end the program
Enter to compute the series
Enter to deal with array
b If the user chooses option the user will be prompted to enter the end of series and will call the
subroutine computeaseriesofnums to compute the series. See below.
Welcome to main menu!
Enter to end the program
Enter to compute the series
Enter to deal with array
Enter the choice:
Enter the end of series:
Sum is
c If the user chooses option another menu will be displayed which contains the following
choices. See below
Welcome to main menu!
Enter to end the program
Enter to compute the series
Enter to deal with array
Enter the choice:
Enter to add an element to the array
Enter to display the array elements
Enter to return to the main menu
If the user enters the program will ask the user to enter a number and store it in the
array. See below.
Enter to add an element to the array
Enter to display the array elements
Enter to return to the main menu
Enter the choice:
Enter the value:
The value is added
If the user enters the program will call the subroutine printarray See below.
Enter to add an element to the array
Enter to display the array elements
Enter to return to the main menu
Enter the choice:
Array elements:
If the user chooses option the program will return to the main menu. See below
Enter to add an element to the array
Enter to display the array elements
Enter to return to the main menu
Enter the choice:
Welcome to main menu!
Enter to end the program
Enter to compute the series
Enter to deal with array
d If the user chooses option from main menu, the program will print a final message and will
exit. See below.
Welcome to main menu!
Enter to end the program
Enter to compute the series
Enter to deal with array
Enter the choice:
Thank you for using the program
e The program should repeat until the user chooses option IMPORTANT
Step 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