Question: C++ 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

C++
C++ Design a struct personalInfo with components id, and name of type

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 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.ixt. 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 1370005 Youset 5437330 Anna 2600004 Abrar 1300002 Sadiq 4 5 3 4 2 72 65 81 85 91 82 94 75 87 68 72 63 52 83 74 66 72 61 Sample input/output: 5 Student Ali with id 1463491 has average 75.75 of 4 courses. Student Yousef with 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

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!