Question: Part 1 : The main loop asks the user for a double - precision number. Use system call 7 to read the number. If the
Part : The main loop asks the user for a doubleprecision number. Use system call to read the number. If the number is zero, exit this loop and go to part If the number is not zero, store it in memory. I hesitate to say store it in an array, but that is what you will be doing. You can use the space directive to allocate this. Since assembly language doesnt really understand anything but memory no type checking this works. Keep track of how many numbers you have. Do not print the number. You may assume there will be no more than numbers entered. Part : Sorting. Write a function do not fall through to inline code that sorts the numbers from smallest to largest. You can use any sorting algorithm you know; I suggest bubble sort because it is easy and you probably know it Parameters to this function are: $a contains the count of numbers entered. You can code this function in the same module as your main program so it can use the name of your list of entered numbers. Grammatical note: numbers are entered, not inputted. Part : Printing. Write a function, called from your main program, that prints the sorted numbers one per line followed by the count of numbers entered, the sum, and the average. You can sum and average the numbers in this function. You can also code this function in the same module as your main program so it can use the name of your list of entered numbers. Register $a will contain the number of items in your list. To recap: Your main function contains a loop that asks for numbers and puts them in a list. When zero is entered, exit the loop and call the two functions, then exit. Your program will be tested with valid floating point numbers only, so no need for error checking. Your program must not crash for valid input. Your program will crash if you press Enter alone to exit. This is normal behavior, not an error, so dont do it when you test. Enter zero.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
