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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question


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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY