Please write a program that computes the average of 3 exam scores of 3 students. It first asks the user three exam scores for each student and then compute the average of them. The program should have the following functions. - int get TestScore(): This function is called by main function. It asks the user to enter the score of the exam. Once it gets a user input data, the function returns it to the main function. Input Validation: Please check if the entered score is between 0 and 100 inclusive (considered valid). If not, repeat asking to enter a valid score. -double calAverage(int, int, int, int, int): This function is called by main function. It calculates the average of 3 exam scores passed from main function in int data type. Once the function calculates the average, it returns it to main function in double data type. -void display(string, double): This function is called by main function and displays the student's name and average exam score. The arguments are students' name and the average exam score. .main(): Main function calls getTestScore() 3 times for each student to get the student's 3 exam scores. And then, it calls calAverage() and display() to compute and displace the average of the 3 exam scores for that student. Please complete this process for 3 students using loop structure.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Project 5 Please write a program that computes the average of 3 exam scores of 3 students. It first asks the user three exam scores for each student and then compute the average of them. The program should have the following functions. • int getTestScore(): This function is called by main function. It asks the user to enter the score of the exam. Once it gets a user input data, the function returns it to the main function. Input Validation: Please check if the entered score is between 0 and 100 inclusive (considered valid). If not, repeat asking to enter a valid score. • double calAverage(int, int, int, int, int): This function is called by main function. It calculates the average of 3 exam scores passed from main function in int data type. Once the function calculates the average, it returns it to main function in double data type. • void display(string, double): This function is called by main function and displays the student’s name and average exam score. The arguments are students’ name and the average exam score. • main(): Main function calls getTestScore() 3 times for each student to get the student’s 3 exam scores. And then, it calls calAverage() and display() to compute and displace the average of the 3 exam scores for that student. Please complete this process for 3 students using loop structure. Submission Requirements • You must submit the program that compiles and runs without any error to receive full points. • Don’t forget to put comments in your source code so that the reader can understand your program easily. • On the top of each source code file, please don’t forget to put your Name.
**CS2250 Project 5**

Please write a program that computes the average of 3 exam scores of 3 students. It first asks the user three exam scores for each student and then computes the average of them.

The program should have the following functions:

- **int getTestScore():** This function is called by the main function. It asks the user to enter the score of the exam. Once it gets a user input data, the function returns it to the main function. Input Validation: Please check if the entered score is between 0 and 100 inclusive (considered valid). If not, repeat asking to enter a valid score.
  
- **double calAverage(int, int, int, int):** This function is called by the main function. It calculates the average of 3 exam scores passed from the main function in int data type. Once the function calculates the average, it returns it to the main function in double data type.

- **void display(string, double):** This function is called by the main function and displays the student’s name and average exam score. The arguments are student’s name and the average exam score.

- **main():** The main function calls getTestScore() 3 times for each student to get the student’s 3 exam scores. And then, it calls calAverage() and display() to compute and display the average of the 3 exam scores for that student. Please complete this process for 3 students using loop structure.

**Submission Requirements**

- You must submit the program that compiles and runs without any error to receive full points.

- Don’t forget to put comments in your source code so that the reader can understand your program easily.

- On the top of each source code file, please don’t forget to put your name.
Transcribed Image Text:**CS2250 Project 5** Please write a program that computes the average of 3 exam scores of 3 students. It first asks the user three exam scores for each student and then computes the average of them. The program should have the following functions: - **int getTestScore():** This function is called by the main function. It asks the user to enter the score of the exam. Once it gets a user input data, the function returns it to the main function. Input Validation: Please check if the entered score is between 0 and 100 inclusive (considered valid). If not, repeat asking to enter a valid score. - **double calAverage(int, int, int, int):** This function is called by the main function. It calculates the average of 3 exam scores passed from the main function in int data type. Once the function calculates the average, it returns it to the main function in double data type. - **void display(string, double):** This function is called by the main function and displays the student’s name and average exam score. The arguments are student’s name and the average exam score. - **main():** The main function calls getTestScore() 3 times for each student to get the student’s 3 exam scores. And then, it calls calAverage() and display() to compute and display the average of the 3 exam scores for that student. Please complete this process for 3 students using loop structure. **Submission Requirements** - You must submit the program that compiles and runs without any error to receive full points. - Don’t forget to put comments in your source code so that the reader can understand your program easily. - On the top of each source code file, please don’t forget to put your name.
Expert Solution
Algorithm

NOTE : As the given question does not specify the programming language in which the program has to be written. So C++ will be used to code the same.

Step 1 : Start

Step 2 : Define a function getTestScore() to input the test score of the student. Taking user input for the test score till a valid score is input by the user. Return the input score if valid.

Step 3 : Define a function calcAverage() to calculate and return the average of the 3 scores.

Step 4 : Define a function display() to print the student name and calculated average.

Step 5 : In the main function , Define a for loop to get the scores for 3 students. In the loop input the name of the student.

Step 6 : Call the calcAverage() function and passing the 3 scores as arguments. Call the display() function to print the student name and their average. Repeat these steps for all the 3 students.

Step 7 : Stop

steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education