Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MIPS assembly code to perform the following task In this assignment, you will iteratively populate a fixed-size integer array of 10 elements, array_a,

Write a MIPS assembly code to perform the following task

In this assignment, you will iteratively populate a fixed-size integer array of 10 elements, array_a, with integer values provided by the user. The user will enter 10 positive integer values, one per line, and the program will store the 10 values in array_a[0], array_a[1], , array_a[9]. Once the 10 integers are entered, your program will print the array, then prompt the user for a search value which may or may not exist in the array. If the value exists, your program must print all locations where the value is stored. If the value does not exist in the array, it will display the message that value does not exist in the array!. After all, output has been displayed, the program should exit (do not prompt for additional input). Input will be entered by the user in the following form: Once all of the input is entered, output will be printed in the following format (where is one of the integers provided by the user): array_a[0] = array_a[1] = array_a[2] = array_a[3] = array_a[4] = array_a[5] = array_a[6] = array_a[7] = array_a[8] = array_a[9] = Next, the prompt for a search value will be given, and input will be accepted in the following form: ENTER A SEARCH VALUE: Which will then print all of the array indices containing that value, one per line, or the constant string that value does not exist in the array!. For example, output when the user enters {1, 1, 2, 3, 4, 5, 6, 1, 7, 8} for the array values and 1 for the search value should be displayed as follows: array_a[0] = 1 array_a[1] = 1 array_a[2] = 2 array_a[3] = 3 array_a[4] = 4 array_a[5] = 5 array_a[6] = 6 array_a[7] = 1 array_a[8] = 7 array_a[9] = 8 ENTER A SEARCH VALUE: 1 array_a[0] = 1 array_a[1] = 1 array_a[7] = 1 If the user instead were provide 99 for the search value, output should be displayed as follows: array_a[0] = 1 array_a[1] = 1 array_a[2] = 2 array_a[3] = 3 array_a[4] = 4 array_a[5] = 5 array_a[6] = 6 array_a[7] = 1 array_a[8] = 7 array_a[9] = 8 ENTER A SEARCH VALUE: 99 That value does not exist in the array!

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions