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 wer). 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. ixt. Calls the user-defined function int maxAverage Index(int, student (1) Prints the id and name of the student with the maximum average. Student.txt: 4 5 1463491 A11 1370005 Youset 5437330 Anna 2600004 Abrar 1300002 Sadiq 72 65 81 85 91 82 94 75 87 68 72 63 52 83 74 66 72 61 NA 4 2 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 2600084 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!