Question

Write MIPS code, please. Following: Write a program to be used by the Wisconsin DNR to...

Write MIPS code, please.

Following:

Write a program to be used by the Wisconsin DNR to track the number of Deer Hunting Licenses issued in a county and the state. It will display a menu with 5 choices numbered 1-5. They are (1) update the count, (2) display the number of licenses already issued to a county whose number is input, (3) display the county number and the number of licenses already issued to a range of counties whose starting and ending county numbers are entered, (4) display the county number and the number of licenses already issued for all 72 counties as well as total licenses issued in the state and the last option (5) is to exit the program. In the event an invalid option is entered the program will print an error message and reprint the menu. In the main you will declare a static array to hold 72 integers and ‘total’ (initialize to 0). All work will be done in subprograms and all arguments will be passed on the system stack. Also, all user input should be validated with an appropriate message if the input is invalid followed by a repeat of the prompting for input.

The ‘menu’ subprogram will receive three arguments (IN), the base address of the array and the count of its elements and the number currently in total. It will have one argument (OUT) the new total which you will store in total. It will repeatedly display the menu, calling each of the selected options until ‘5’ is selected when it will return to the main. If option 2 is selected it will ask for the number of the county to be displayed prior to calling the appropriate subprogram.

The ‘update’ subprogram (option 1) will receive three arguments (IN), the base address of the array and the count of its elements and the current total. It will have one argument (OUT) the new total. It will ask the user for the number (n) of the county you wish to update, it will validate that the county number is valid (1-72) or print an error message, it will than display the current number of licenses issued (labeled). It will ask the number of new licenses that are being issued. It will the update element n-1 and the total by the number entered.

The ‘single’ subprogram (option 2) will receive two arguments (IN), the base address of the array the number of the county to be displayed and no arguments (OUT). It will display the county number and the number of licenses that have been issued.

The ‘range’ subprogram (option 3) will receive two arguments(IN), the base address of the array and the count of its elements and no arguments (OUT). It will ask the user for the starting and ending county numbers. It will validated them and insure that the starting number is less than or equal to the ending number. If it fails to pass these tests it will print an error message and repeat the prompt. It will then call the ‘single’ subprogram in a loop to output the county number and the number of licenses issued for the counties in the range.

The ‘all’ subprogram (option 4) will receive three arguments (IN), the base address of the array and the count of its elements and the current total and no arguments (OUT). It will then call the ‘single’ subprogram in a loop to output the county number and the number of licenses issued for the all the counties. It will then print the total of all the counties properly labeled.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: MAIN: ; 1w the val $a0 0 ($sp) 1s the ARG LW $5, 0 ($29) ; considers the arg Şal and Şsp ADDIU $6, $29,4 :considers t

Add a comment
Know the answer?
Add Answer to:
Write MIPS code, please. Following: Write a program to be used by the Wisconsin DNR to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please write a Java program that does the following: Create an array of 100 integers. Store...

    Please write a Java program that does the following: Create an array of 100 integers. Store 100 random integers (between 1 and 100) in the array. Print out the elements of the array. Sort the array in ascending order. Print out the sorted array. Prompt the user to enter a number between 1 and 100. Search the array for that number and then display "Found" or "Not Found" message. Display each number from 1 to 100 and the number of...

  • Using Java In this assignment we are working with arrays. You have to ask the user...

    Using Java In this assignment we are working with arrays. You have to ask the user to enter the size of the integer array to be declared and then initialize this array randomly. Then use a menu to select from the following Modify the elements of the array. At any point in the program, if you select this option you are modifying the elements of the array randomly. Print the items in the array, one to a line with their...

  • Please design, write the code and create the requisite submission files in C++ for the following...

    Please design, write the code and create the requisite submission files in C++ for the following problem: A menu-driven program that offers the user 5 options as follows: Menu: 1. Display array 2. Add up all elements in the array and display that number. 3. Add 1 to each element in the array. 4. Swap the values in row one with the values in row three. 5. Exit In main(), declare and initialize a 2-dimensional array that contains 5 x...

  • Please complete this code for java Lab Write a program as follows: Create an array with...

    Please complete this code for java Lab Write a program as follows: Create an array with 10 elements. The array should contain numbers generated randomly between 1 and 100 Ask the user to enter any number - Search the array to see if the user entered number is in the array If the user-entered number is in the array, print a 'match found' message. Also print at which index the match was found, else print a 'match not found' message...

  • In C Program This program will store the roster and rating information for a soccer team. There w...

    In C Program This program will store the roster and rating information for a soccer team. There will be 3 pieces of information about each player: Name: string, 1-100 characters (nickname or first name only, NO SPACES) Jersey Number: integer, 1-99 (these must be unique) Rating: double, 0.0-100.0 You must create a struct called "playData" to hold all the information defined above for a single player. You must use an array of your structs to to store this information. You...

  • Q-1: Write a program in Assembly language using MIPS instruction set that reads 15 integer numbers...

    Q-1: Write a program in Assembly language using MIPS instruction set that reads 15 integer numbers from user and stores all the numbers in the array intArray. Now, read another integer number N from the user, find the total number of array elements that are greater or equal to the number N, and the total number of array elements that are lower than the number N You must have two procedures: i. ReadIntegerArray: this procedure should read integer array elements...

  • JAVA - the program should output as follows: Please enter a seed: 2345 Please enter the...

    JAVA - the program should output as follows: Please enter a seed: 2345 Please enter the size of the array: 1 Array size must be greater than 1. Please reenter: 0 Array size must be greater than 1. Please reenter: -1 Array size must be greater than 1. Please reenter: 8 Please choose an option: 1 Print the array 2 Find the average 3 Find the largest element 4 Count how many times 3 occurred 5 Count how many elements...

  • Python 3.7 to be used. Just a simple design a program that depends on its own. You should also not need to import anythi...

    Python 3.7 to be used. Just a simple design a program that depends on its own. You should also not need to import anything. No code outside of a function! Median List Traversal and Exception Handling Create a menu-driven program that will accept a collection of non-negative integers from the keyboard, calculate the mean and median values and display those values on the screen. Your menu should have 6 options 50% below 50% above Add a number to the list/array...

  • This program will store a roster of most popular videos with kittens. The roster can include...

    This program will store a roster of most popular videos with kittens. The roster can include at most 10 kittens.You will implement structures to handle kitten information. You will also use functions to manipulate the structure. (1) Create a structure kitten. The structure should contain the following attributes: name; string color; string score; integer Important! The name of the structure and each of its field must match exactly for the program to work and be graded correctly. (2) Create a...

  • using java Program: Please read the complete prompt before going into coding. Write a program that...

    using java Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT