In the main () function, you should 1) open the input text file with filename "gardes.txt" 2) call read Data() function to load the data into an array 3) call getAverage() function to compute the average 4) call aboveAverage() function to find the number of grades above the average. 5) close the input file.

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
Topic Video
Question
100%
C++ language
Suppose a file contains the final grades of a class. Assume that the number of student grades
stored in a file is not known, but does not exceed 150. Write a complete C++ program to
perform the following computations.
1. Write a function to load the grades from a text file into an array, and returns the total
number of grades:
int readData(ifstream fileID, int list[])
2. Write another function to find the average of all grades and returns the average:
double getAverage(const int list[], int length)
3. Write another function that returns the number of students whose grades are above the
average:
double aboveAverage (const int list[], int length, double
avg)
where,
fileIDis the identifier for the input file;
list[] is an integer array with size 150 for storing data;
length is the actual size of the stored data.
avg is the average
In the main () function, you should
1) open the input text file with filename "gardes.txt"
2) call readData() function to load the data into an array
3) call getAverage() function to compute the average
4) call aboveAverage() function to find the number of grades above the average.
5) close the input file.
Transcribed Image Text:Suppose a file contains the final grades of a class. Assume that the number of student grades stored in a file is not known, but does not exceed 150. Write a complete C++ program to perform the following computations. 1. Write a function to load the grades from a text file into an array, and returns the total number of grades: int readData(ifstream fileID, int list[]) 2. Write another function to find the average of all grades and returns the average: double getAverage(const int list[], int length) 3. Write another function that returns the number of students whose grades are above the average: double aboveAverage (const int list[], int length, double avg) where, fileIDis the identifier for the input file; list[] is an integer array with size 150 for storing data; length is the actual size of the stored data. avg is the average In the main () function, you should 1) open the input text file with filename "gardes.txt" 2) call readData() function to load the data into an array 3) call getAverage() function to compute the average 4) call aboveAverage() function to find the number of grades above the average. 5) close the input file.
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Instruction Format
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.
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