Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

by using project linking the header i want the program to be written in C++. i want it to be in 5 files = 3

by using project linking the header

i want the program to be written in C++.

i want it to be in 5 files = 3 cpp and 2 header.

for example

student.h

section.h

studentimp.cpp

sectionimp.cpp

main.cpp

======================

student.txt

Abass Physics 43 Adel CS 63 Amal Engineering 87

======================

Define a class Student that has the private members name, department, and mark. The class has the public members set(), getMark(), get(), print( ), and a default parameterized constructor (with default values Ali as a name, Physics as a department, and 83 as a mark).

Define a class Section that has the private members number, numberOfStudents, and a pointer p of type Student. The class has the public members set(), print(), findAverage(), and a default parameterized constructor (with default values 11 as the section number, and 12 students).

Write the definition of the two classes Student and Section with their implementations, enforcing the least privileged principle.

The following driver produces the given sample of output:

int main()

{

Section abc(11, 2);

abc.print();

abc.set(4);

abc.print();

return 0;

}

Sample output:

Section 11 has the following students:

Ali from the Physics department scored 83

Ali from the Physics department scored 83

The section average is 83

Section 4 has the following students:

Abass from the Physics department scored 43

Adel from the CS department scored 63

Amal from the Engineering department scored 87

The section average is 64.3333

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Explain strong and weak atoms with examples.

Answered: 1 week ago

Question

Explain the alkaline nature of aqueous solution of making soda.

Answered: 1 week ago

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago