Question: This is C++ assignment. Grade1.txt 1 90 2 100 3 89 4 72 5 68 1 92 2 98 3 85.5 4 77 4 82.5

This is C++ assignment.

This is C++ assignment. Grade1.txt 1 90 2 100 3 89 472 5 68 1 92 2 98 3 85.5 4 77 482.5 1 97 1 87 1 92 2 86.5 2 76 Grade2.txtis blank Grade3.txt 1 90 2 100 3 89 4 72 568 1 92 2 98 3 85.5 4 77 4 82.5 197 1 87 1 92 2 86.5 2 76 3 75.5 5

Grade1.txt

1 90 2 100 3 89 4 72 5 68 1 92 2 98 3 85.5 4 77 4 82.5 1 97 1 87 1 92 2 86.5 2 76 

Grade2.txt is blank

Grade3.txt

1 90 2 100 3 89 4 72 5 68 1 92 2 98 3 85.5 4 77 4 82.5 1 97 1 87 1 92 2 86.5 2 76 3 75.5 5 100 4 92 3 99.5 4 83.5 6 100 

And this is the templete for the assignment

#include  #include  #include  #include  using namespace std; // Function prototypes int readFile(const string &fileName, int studentId[], double grades[], int maxGrades); double minimumGrade(const double grades[], int numberGrades); void displayForStudent(int id, const int studentId[], const double grades[], int numberGrades); // additional function prototypes go here int main() { // create the arrays. Maximum number of grades is 20 // this will contain the actual number of grades read in // from the input file int numberGrades; // input file name string inputFileName; cout   Your program will need to have two arrays. One will be of type int, called student Id in this document. The other is of type double, called grades in this document. You may use different names for your variables, but they must be of types int and double. If you use different names you will have to change your main function. The maximum number of elements supported by the arrays is 20 elements. Your program will be using partially filled arrays. You will be reading in the array values from a file. The name of the file is read in at execution time. These files will have zero or more student id and zero or more grades. You program must be able to process up to 20 student ids and grades. If there are more than 20 student ids and grades your program must only process the first 20. Do not go out of bounds on your arrays. The format of the file is as follows (this is a subset of file grades1. txt): 90 100 89 72 68 92 So 1, above, is the student id and 90 is a grade associated with that student id. Similarly, 2 is a student id with a grade of 100, and 3 is a student id with a grade of 89, and so on. There may be multiple entries for every student id. They will not be in order. Notice that student one is in the above list twice, but there are other student grades in between the two student 1 entries. To read into two arrays you will need to create in ifstream object and open it for file grades.txt. Assuming you have opened an ifstream called input File you can read into the two arrays as follows (assuming index has been initialized and is the next student id or grade to be read in) input File student Id index] grades Cindex] Make sure you check for end of file and also make sure you check to make sure there is still room in the arrays. The code above (inputFile will return false if there is no addition data in the input file. The maximum number of entries is 20. If you have more than 20 grades in the input file your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!