Answer is wrong on existing platforms. Don't copy Paste I need write code for it

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Answer is wrong on existing platforms. Don't copy Paste

I need write code for it

Design a struct personallnfo 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 set( ), 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 maxAveragelndex(int, student [ ])
Prints the id and name of the student with the maximum average.
Student.txt:
1463491 Ali
1370005 Yousef 5
5437330 Amna
4 72 65 81 85
91 82 94 75 87
3 68 72 63
52 83 74 66
1300002 Sadiq
4.
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.
Transcribed Image Text:Design a struct personallnfo 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 set( ), 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 maxAveragelndex(int, student [ ]) Prints the id and name of the student with the maximum average. Student.txt: 1463491 Ali 1370005 Yousef 5 5437330 Amna 4 72 65 81 85 91 82 94 75 87 3 68 72 63 52 83 74 66 1300002 Sadiq 4. 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.
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY