Question: C++ C++ help! a Design a struct personalinfo with components id, and name of type string. Design a class student with private data member's person
a Design a struct personalinfo with components id, and name of type string. Design a class student with private data member's person (struct variable of type personalInfo), numberOfCourses (of type integer), average (of type float), and marks[] an array of student's marks of type integer. The class also has the member functions ser, getPerson(), print(), findAverage(), getAverage(), and a parameterized constructor with default value 1 for the number of courses. Implement the member functions of the class student. The member function findAverage() is used to calculate the average mark for each student Write a driver that does the following: Declares the array section of objects of student type. Reads the number of students. Reads information for each student from the file student.txt. Calls the user-defined function int maxAverageIndex(int, student (1) Prints the id and name of the student with the maximum average. Student.txt: 1463491 Ali 4 72 65 81 85 1370005 Yousef 591 82 94 75 87 5437330 Anna 3 68 72 63 2600004 Abrar 4 52 83 74 66 1300002 Sadiq 2 72 61 Sample input/output: 5 Student Ali with id 1463491 has average 75.75 of 4 courses. Student Yousef with id 1370005 has average 85.8 of 5 courses. Student Amna with id 5437330 has average 67.6667 of 3 courses. Student Abrar with id 2600004 has average 68.75 of 4 courses. Student Sadiq with id 1300002 has average 66.5 of 2 courses. Student 1370005 Yousef has the maximum average
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
