Write a program that fills an array with user input and displays 1) size, 2) average, 3) maximum and 4) minimum value of the array. I. Create four source files (.asm) as follows. (Refer to the class lectures for details.) 1) A file containing the definitions of the following three functions. (You may name it io.asm.) getInput stoi itos 2) A file containing the definition of the following function, ; Function computeAvg (value-returning function) ; Purpose: Compute the average of the elements in an array ; Parameter 1: address of array (pass by reference)- input parameter ; Parameter 2: array size (pass by value)- input parameter ; Return value: average of the elements in an array 3) A file containing the definition of the following function, ; Function maxMin ; Purpose: Find the largest and smallest values in an array ; Parameter 1: maximum of an array (pass by reference)- output parameter ; Parameter 2: minimum of an array (pass by reference)- output parameter ; Parameter 3: address of array (pass by reference)- input parameter ; Parameter 4: array size (pass by value)- input parameter 4) A file containing the main program which does the following. 1. Fill an array with values entered by user: Call functions getInput and stoi in a loop 2. Call computeAvg 3. Call maxMin 4. Call itos to convert the average, maximum, and minimum into ASCII 5. Display the results as shown above. (system calls) II. Create a makefile to assemble, link, and run. (Refer to
Write a program that fills an array with user input and displays 1) size, 2) average, 3) maximum and 4) minimum value of the array.
I. Create four source files (.asm) as follows. (Refer to the class lectures for details.)
1) A file containing the definitions of the following three functions. (You may name it io.asm.)
getInput
stoi
itos
2) A file containing the definition of the following function,
; Function computeAvg (value-returning function)
; Purpose: Compute the average of the elements in an array
; Parameter 1: address of array (pass by reference)- input parameter
; Parameter 2: array size (pass by value)- input parameter
; Return value: average of the elements in an array
3) A file containing the definition of the following function,
; Function maxMin
; Purpose: Find the largest and smallest values in an array
; Parameter 1: maximum of an array (pass by reference)- output parameter
; Parameter 2: minimum of an array (pass by reference)- output parameter
; Parameter 3: address of array (pass by reference)- input parameter
; Parameter 4: array size (pass by value)- input parameter
4) A file containing the main program which does the following.
1. Fill an array with values entered by user: Call functions getInput and stoi in a loop
2. Call computeAvg
3. Call maxMin
4. Call itos to convert the average, maximum, and minimum into ASCII
5. Display the results as shown above. (system calls)
II. Create a makefile to assemble, link, and run. (Refer to the lecture slides for details.)


Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









