Professional Documents
Culture Documents
Term Project PF
Term Project PF
Term Project PF
th
Deadline: Saturday, 24 September, 2022
Problem: You have to make a grade calculator. Two text file named “marks.txt” and
“students.txt” are given. These files contains marks and student details of 10 subjects. You
have to read file marks.txt and calculate grade of each subject. The grade will be calculated
through a function “grade_calculator()”. Following is the distribution of grading based on
marks. The result should be saved in a text file.
Marks Grade
90 and above A
80 and above B
70 and above C
60 and above D
Below 60 F
Implement a function based upon above distribution. Read the marks from “marks.txt” file in to
an array, say “marks_arr[] of size 10”. Call the function “grade_calculator()” and send data from
“marks_arr[]” to the “grade_calculator()” function. Remember that we use actual parameters
to send data to the function while calling the function and formal parameters receive this data
in the definition of function. Remember to deal arrays as pointers.
grade_calculator():
Your function “grade_calculator()” should compute grade against each subject’s marks and
return an array of grades. Use index numbers to track the student number.
Write a file which displays names roll numbers, subject marks and grade, all space separated.
Rubric:
Implementation Points
Definition of variable, arrays, fstream identifiers with meaningful names 5
You can achieve 100% in this assignment as maximum marks by doing original work and
following up the rubric.
In case of Plagiarism, straight zero will be awarded and no further evaluation will be taken
form the student.