how to compute the final grade uisng an array

i need to write a C++ program to compute the final grade of each course taken by a group of students in an institution of higher learning for particular semester. the program should also compute the students' grade point average(GPA) and generate an academic report on the performances of the students. your program should:

1. read the students' data (i.e. matric number, course work grades, exam grades, number of unit, etc)
2. compute and print the final grade of each course taken by each student to an output file
3. compute and print the students' grade point average(GPA) in the same file
4. identity whether a student is 'active' or under probation after the GPA is computed with appropriate messages
5. print appropriate messages if the student needs to repeat a certain course. indicate the number of courses needed to be repeated, if any
6. determine whether the student is eligible for the Dean's list certificate. a student is eligible for the Dean's list certificate if she/he obtain a GPA of at least 12 units of courses
7. print out the students' matric numbers with their GPA in an unsorted list to an output file
8. print out the students' matric number with their GPA in a sorted list to the same output file(in descending order according to the GPA)
9. assume that the number of course taken by each student might be different from one another


to compute the final grade for each course, a lecture needs to submit the grade point for coursework (30% or 40%) and grade point for exam (70% or 60%). the combination of both coursework and exam components is based on the middle grade point rounding method as shown below:

the letter grade , grade pointer, middle grade point:
A -4.00 (3.84-4.00)
A- -3.67 (3.50-3.83)
B+ -3.33 (3.17-3.49)
B -3.00 (2.48-3.16)
B- -2.67 (2.50-2.83)
C+ -2.33 (2.17-2.49)
C -2.00 (1.84-2.16)
C- -1.67 (1.50-1.83)
D+ -1.33 (1.17-1.49)
D -1.00 (0.84-1.16)
D- -0.67 (0.34-0.83)
F -0.00 (0.00-0.33)
under the GPA system, a student undergoing the first degree program will be assumed passing a course if she/he obtain a grade point at least 2.00. if the student scores below the passing grade point, he/she has to repeat the course. the student needs to get a GPA of at least to be in an 'active' status. if not, they are placed under probation.

GPA=(course units*grade point for course)/ course unit

assume that you don't know the number of students, such that your program should terminate when the end-of-file is encountered. your program should not be inter-active as your input must come from a file . avoid using global function prototypes. your program should at least contain the following functions:

1. void main()
2. void input_data(...) - to read the students' data from an input file
your input data should contain the following information:

i. student's matric number(5 digits) stored in an array
ii. the number of course taken that semester. this data item must be
stored as a pointer
iii. the grade points for coursework and examination for each course
iv. the number of units for each course
v. the evaluation system used; code 1 for (30/70)% system and code 2 for
(40/60)% system. this code must be stored as a array
this function should also print these data items in a particular
format shown at the back
3. void compute_grades(...) which receives the data from the input_data() function and compute and prints the grade for each course for each student
4. double GPA(...) which calculates the GPA of each student. the GPA value must be returned via the function name
5. void print_report(...) which prints the report containing the following information:
i) the GPA calculated in GPA(...) function
ii) the active or probation status
iii) if the student needs to repeat a certain number course
6. void print_out(...) which prints the unsorted and also the sorted lists of the matric number with the corresponding GPA, i.e; your program should call this function twice, the first time to print out the unsorted list and the second time to print the list after it has been sorted according to the GPA
7. void sort_list(...) which sorts the list containing the GPA together with the matric number. the list should be sorted according to the GPA in descending order


your data in the input file should be arranged in the following form:

56678 4 3.00 2.33 4 1
1.67 2.67 4 2
3.33 2.00 3 1
3.67 3.33 4 1

47684 5 4.00 2.00 3 2
3.33 3.67 4 2
0.33 3.67 4 1
4.00 2.00 4 1
3.67 0.67 2 1
:
:
:
:
88445 4 2.67 2.33 4 2
0.00 3.00 4 1
3.00 3.33 4 2
3.33 2.67 3 2

the students' data must be read in form an input file. for this problem , assume that the array size does not exceed 30. all the output must be printed onto an output file. a sample output is as follows:




Topic archived. No new replies allowed.