Term Project PF

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Term Project

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

Incomplete definition of variable, arrays, fstream identifiers with meaningless 1


names
Opening and Closing File 2.5+2.5=5
Incomplete opening and closing 1
Reading and writing File successfully 2.5+2.5=5
Incomplete reading and writing file 1
Function implementation with correct syntax and correct implementation of 2.5+2.5=5
structure(body: the checks you needs to perform)
Incomplete implementation and wrong or incomplete structure 1
Call of function with correct syntax, parameters and storage of returned 5
values
Incomplete/wrong function call/parameters 1
Usage of arrays as pointers 5
Poor usage of arrays/pointers 1
No usage of arrays/files/function/Pointers 0
Total 30

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.

You might also like