Question: Define a struct called Child with components name, age, and toysCost. Define a class called Kindergarten that has private members name, cost, numberOfChildren, kids [

Define a struct called Child with components name, age, and toysCost.
Define a class called Kindergarten that has private members name, cost, numberOfChildren, kids [] an array of type Child, claculate Cost(). The class has the public members set(),get(),getCost(),pr(), and a default parametrized constructor.
Implement all member functions of the class enforcing the concept of information hiding.
Use the following driver:
int main()
{
Kindergarten KG;
KG.set("Al-Baraem", 3);
KG.print();
return 0 ;
Contents of the "Child.txt" file:
Ali Omar, 4150
Hussein Ahmed, 3177
Amal Abass, 7312
Ibrahem Adnan, 6358
Fatima Ali, 5489
Sample Output:
Al-Baraem Kindergarten has 3 children with toys worth 639 dirham
 Define a struct called Child with components name, age, and toysCost.

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!