Question: Write a C/C++ program that will read a file of student grade records and do the following tasks, where the specific task to be performed

Write a C/C++ program that will read a file of student grade records and do the following tasks, where the specific task to be performed is determined by the following command line parameters passed to the main program. All of the parameters are optional and can occur in any order when the program is invoked. Multiple parameters can be given at the same time. Your program should perform each task given. If no parameters are given, your program should print a list of the available parameters.

The input file consists of one record per line. Each record shows the grade and the number of credits a student received for one course in the order: ID-number number-of-credits letter-grade. The values for each record will be separated by spaces. Each record will start on a new line. The student ID number and the number of credits will be integers, and the grade will be one of A, B, C, D, or F. For example, the first few lines look like the following:

2554 3 B

5934 2 A

6978 4 C

5934 2 D

.

You should use a struct like the following in your program:

struct StudentRecord {

int ID;

double GPA;

int numCredits;

int numCoursesTakenSoFar;

char letterGrade[100]; // letterGrade[i] contains the grade for

// the ith course the student has taken

}

You may add fields to this struct as needed. Your program will not know when it begins how many records are in the input file. So, you must use appropriate data structures and dynamic memory allocation techniques to allow your program to automatically adjust to any size input file.

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!