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.)
![4414 ranger0$ make
make: 'avgMaxMin' is up to date.
4415 ranger0$ rm *.o
4416 ranger0$ make
nasm -g -felf64 main.asm
inasm -g -felf64 maxMin.asm
nasm -g -felf64 jo.asm
nasm -g -felf64 computeAvg.asm
d -g -o avgMaxMin main.o io.0 computeAvg.o maxMin.o
4417 ranger0$ ./avgMaxMin
Enter a number or ō to quit: 65
Enter a number or 0 to quit: 70
Enter a number or 0 to quit: 75
Enter a number or 0 to quit: 80
Enter a number or 0 to quit: 85
Enter a number or 0 to quit: 100
Enter a number or 0 to quit: 95
Enter a number or 0 to quit: 60
Enter a number or 0 to quit: 90
Enter a number or 0 to quit: 0
Аггау size:
Average:
Maximum value: 100
Minimum value:_60
4418 rangerO$
9
80](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F892d4f47-b17e-4d99-8239-1f3dc0832c3e%2F3d44f310-c1e1-4994-b3b6-b306a8df24bd%2Fn27giso_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)