Write a program that defines a class to keep track of student grades.The information the student class includes are the student’s first name, last name, a six-digit ID number, and a struct marks the struct marks contains five programming assignment scores, a midterm score, a final exam score, and final grade. Your program should assume the students data is stored in a file students.txt The file contains each students info followed by his grades in assignments, midterm and final exam, however the final grade is not provided it must be calculated by your program.
Your class shall contain the following functions. a. a function getData that reads the info from the file and stores them in an array of class student. b.A function clcGrade that assignes a value to the variable grade in struct marks. The Grade can be calculated as follows: Assignments total 10%, midterm 40% , and the final exam is 50%. Students with 90 and above averages earn an A, above 80 earn a B, above 70 earn a C, above 60 earn a D, and all grades below 60 earn an F. Your function should assign the grade to the final Grade variable. Your main function should define an array of students, , calls the function getData, calls the function clcfinal, and finally displays the Results of the students as shown below. here is the definition of the class and the structure you are going to use to solve this question.
struct marks
{
float assignments[5];
float midterm;
float Final;
char grade;
};
class student
{
private:
string Fname;
string Lname;
long ID;
marks m;
public:
student();
student(string="",string="",long=999999);
void setname(string,string);
void setID(long);
void setmark(marks);
void getname(string &,string &);
long getID();
marks getmark();
void display();
};
Note: you have to write the implementation of public member functions.
20060005 EMAN ALI C
20050002 AHMED ALI A
ID NAME GRADE