For each of the following exercises, write a function and make the appropriate function call in main. Comments are to be added in the program.   Write a void function to find the average score for each student and store in an array studentAvgs.

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

For each of the following exercises, write a function and make the appropriate function call in main.

Comments are to be added in the program.

 

  1. Write a void function to find the average score for each student and store in an array studentAvgs.

 

void AverageScores( const int scores[][MAX_TESTS],

                       int numberOfStudents,

                       int numberOfTests,

                       double studentAvgs[])

 

  1. Write a void function to find the average score for each test and store in an array testAvgs.

 

 

  1. Write a void function to print the average score for each student, i.e. print the contents of the array studentAvgs. The output will be well formatted and accompanied with appropriate messages.

 

 

  1. Write a void function to print the average score for each test, i.e. print the contents of the array testAvgs. The output will be well formatted and accompanied with appropriate messages.

 

 

  1. Add the following to define an array named passing in the function main. This array will be used to hold the performance of each student, whether the student is passing or not.

 

bool passing[MAX_STUDENTS];

 

 

 

  1. Write a function that initializes all components of the array passing to false. The array passing is a parameter.

 

void Initialize(bool passingArray[],int numberOfStudents)

 

  1. Write a function that has the array passing, array studentAvgs, and numberOfStudents as parameters.  The function will set the components of passing to true whenever the corresponding value in studentAvgs is greater than or equal to 0

 

  1. Write a function that has the array passing as parameter and print the number of students who passed, i.e. count and print the number of components in passingArray that are true. It will also print which students passed.  Display meaningful messages.

 

  1. Write a function that has studentAvgs and numberOfStudents as parameters, and determine the highest average score of the class. The highest average score and the student number with this value will be formatted and printed with an appropriate message.

 

  1. Complete the program with the functions and the appropriate function calls. Run the program using the following test data:

 

Number of students :  6

Number of tests: 5

The test scores for the 6 students:

(note that each row represents the five test scores for one student)

69  80  90  95  93

75  90  95  87  89

50  50  60  60  68

40  45  30  50  49

25  35  45  49  52

60  62  77  69  72

 

Note: Your program will have good layout following the guidelines for program layout.  It will also have appropriate comments and function headers with good description.

 

Run the program again using at least two other data sets using a different number of students and tests for each test run.

 

The output from the program must be clear, well-formatted and meaningful.

 

Submit the .cpp file, .exe file and the file with the documentation to Moodle.

 

 

Expert Solution
steps

Step by step

Solved in 2 steps

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