CPP Questions, APPLE class - 29642

Solution Posted by
jordanblink

jordanblink

Rating : (19)A+
Solution Detail
Price: $20.00
Request Description

1: Consider the class Apple. Given your knowledge of some common components of apples

•show a class hierarchy in which the class Apple inherits from other classes, which, in turn, can also be inherited from yet other classes;

•discuss inheritance from class Apple for other closely related derived classes; and

•discuss the common components of class Apple.

 

2: Given the following program description, 

•identify the required classes/objects necessary to achieve the program requirements;

•briefly describe any relationships that might exist between your classes; and

•briefly describe the overall hierarchy of your proposed classes.

 

Program Description - You have been asked to create a program designed to ring up orders in any store. The program must create a new electronic "shopping cart" with a unique ID that can be associated with a specific customer. The shopping cart must accept any number of items including both taxable and non-taxable items, and it should calculate the tax on the order and display the final price.

 

3: Define and implement the overloaded constructors that support the following test function for a Date class. The data members for the Date class are: 

•year - integer number

•month - integer number

•day - integer number

 
Solution Description

Answers to the CPP questions

1: Consider the class Apple. Given your knowledge of some common components of apples

·         show a class hierarchy in which the class Apple inherits from other classes, which, in turn, can also be inherited from yet other classes;

ANSWER: Apple class is inheriting from the Fruits class which in turn inherits from the Food class.

        discuss inheritance from class Apple for other closely related derived classes; and

Attachments
Answers to the CPP questions.docx
Answers to the ...