1. Create a file with the following data:
No of students on file – type integer
Then for each student
Student ID Number-type long
Student name- type integer[81]
Total credits- integer
Grade Point Average- float
Sample data:
3
0558899 Roger, R. 12 3.8
5646489 Jack, J. 24 2.5
1641564 John, B. 36 3.3
NOTE: THE STUDENTS NAME MUST HAVE NO EMBEDDED SPACES. WITH NO EMBEDDED SPACES YOU CAN READ THE NAME INTO AN ARRAY OF CHARACTERS USING THE EXTRACTION OPERATOR:
Char name[81];
Cin>>name;
2. Using the file you just created, write a C++ program that creates student reports for each student on the file as follows:
Student Name: Roger, R.
Student Id number: 0558899
Total Credits Grade Point Aversge Grade
12 3.8 B
The grade is computed as follows:
If the GPA is over 4.0 the student’s grade is A
If the GPA is less than 4.0 but grater ot equal to 3.0 the student’s grade is B
If the GPA is less than 3.0 but greater or equal to 2.0 the student’s grade is C
If the GPA is less than 2.0 but greater or equal to 1.0 the student’s grade is D
Otherwise the student grade is F
3. Redo part 2 and use SENTINEL -controlled loop instead of a count-controlled loop. To do this you must remove the “Number of Students on the file” data item(in the example ,3) and insert SENTINEL value at the end of the file.
4. Redo part2 and use an “end of file” loop. Be sure to remove the SENTINEL value added to the end of the file.