elp me for solution..

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

Help me for solution.. 

 

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 personallnfo),
mumberOfCourses (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 find.Average( ) 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
137000s
5437330
2600004
1300002 Sadig
Ali
72 65 81 85
91 82 94 75 87
68 72 63
4 52 83 74 66
2 72 61
Yousef
Amna
Abrer
Sample input / output:
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.
45342
Transcribed Image Text: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 personallnfo), mumberOfCourses (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 find.Average( ) 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 137000s 5437330 2600004 1300002 Sadig Ali 72 65 81 85 91 82 94 75 87 68 72 63 4 52 83 74 66 2 72 61 Yousef Amna Abrer Sample input / output: 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. 45342
ame of type string.
person (struct variable of type personallnfo).
oat), and marks ) an array of student's marks of
s ser ). getPerson( ), prini ). findAverage( ),
ault value 1 for the number of courses.
e the average mark for each student.
m average.
student - Notepad
File Edit Format View Help
1463491 Ali
4 72 65 81 85
1370005 Yousef 5 91 82 94 75 87
3 68 72 63
4 52 83 74 66
2 72 61
5437330 Amra
2600004 Abrar
1300002 Sadiq
average 7!
as averagi
average
s average
s average
naximum avi
Transcribed Image Text:ame of type string. person (struct variable of type personallnfo). oat), and marks ) an array of student's marks of s ser ). getPerson( ), prini ). findAverage( ), ault value 1 for the number of courses. e the average mark for each student. m average. student - Notepad File Edit Format View Help 1463491 Ali 4 72 65 81 85 1370005 Yousef 5 91 82 94 75 87 3 68 72 63 4 52 83 74 66 2 72 61 5437330 Amra 2600004 Abrar 1300002 Sadiq average 7! as averagi average s average s average naximum avi
Expert Solution
steps

Step by step

Solved in 4 steps with 5 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