Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ USING XCODE please create 5 files 3 cpp (the main is driver.cpp) and childimp.cpp and toyimp.cpp 2 headers (toy.h and child.h) Define a class

C++

USING XCODE

please create 5 files

3 cpp (the main is driver.cpp) and childimp.cpp and toyimp.cpp

2 headers (toy.h and child.h)

image text in transcribed

Define a class called Toy with private members name, and cost of type double. The class has the public members set(), a parameterized constructor with default values for the data members, and a destructor. The class includes a static data member totalCost of type double to calculate the total cost of all toys, and a static function getTotalCost(). Define a class called Child with private members name. The class has the public members set(), a parameterized constructor with default values for the data members, and a destructor. The class includes a static data member count of type int to count total number of children, and a static function getCount(). Implement all member functions of both classes. Use the following driver produces the given sample of input / output: int main() { double avg; Child firstChild; Child secondChild; Child thirdChild; firstChild.set("Ali", 1); secondChild.set("Mariam", 2); thirdChild.set("Omar", 1); cout

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_2

Step: 3

blur-text-image_3

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago