Question: Define a struct called Course that has the components code, title, grade ( of type string ) , credit, and cost ( of type integer

Define a struct called Course that has the components code, title, grade (of type string),credit, and cost (of type integer).Define a struct called Finance that has the components type (of type string), and amount (oftype integer).Define a class called Student that has the following private members: id and name of type string, numberOfCourses of type integer, the array listOfCourses[30] of struct variables of type Course, numberOfFinances of type integer, the array listOfFinances[5] of struct variables of type Finance, and GPA of type float.The class also has the following public members: set(string, string), which sets the id and name of a student. It reads the components ofall courses: code, title, grade, credit, and cost from the Courses.txt file into thelistOfCourses[] array. It reads the components of all finances: type and amount fromthe Finances.txt file into the listOfFinances[] array. The function also keeps track ofthe number of courses and number of finances it has read from the files. print(), which prints the students information as shown in the output below. calculateGPA(), which calculates the GPA of the student findFinance(), which calculates the total cost = total credit cost + total finances. Notethat the cost of each course is equal to the number of credits multiplied by the cost ofeach credit of that course, ( credit * cost ). default parameterized constructor with default values "12345678" and Omar Ali asthe student id and name.Save the two structs and the class definitions in the file Student.hImplement the member functions of the class in the file StudentImp.cppSave the following driver in the file Student.cppint main(){Student one;one.print();one.set("87654321", "Ali Omar");one.print();return 0;}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!