Multiple Inheritance

Can someone help me on this question? The following class diagrams are designed for a restaurant that also provides home delivery services. Study the given class diagrams, additional information and answer questions that follow:

HomeMeal
address: string
HomeMeal(string, string, double, int, double)
showHomeMeal():void

Split into class DineInMeal and HomeDelivery

DineInMeal
mealSet: string
price: double
DineInMeal(string, double)
showDineInMeal():void

HomeDelivery
district: int
deliveryFee: double
HomeDelivery(int, double)
showHomeDelivery():void

Additional Information:
1.showDineInMeal() Uses cout to display its respective data members

2.showHomeDelivery() Checks the home delivery district. If it is 123, the delivery
fees is $5, if it is 135, the fees is $10, otherwise the delivery
fees is $20. Set the deliveryFee accordingly.

3.showHomeMeal() Uses cout to display its respective data members. Invokes
showDineInMeal() and showHomeDelivery(). The total charge is the sum of price and deliveryFees. Display the total charges.

(a) Recognize the value of inheritance and using C++ code, construct the class
specification for:
(i) Base classes: DineInMeal and HomeDelivery
(ii) Derived class: HomeMeal

(b) Develop C++ code to implement the constructor and methods found in the:
(i) Base classes: DineInMeal and HomeDelivery
(ii) Derived class: HomeMeal

(c) Write a test driver to test the following requirements with the given test data.
 Use the following test data to instantiate TWO instances of HomeMeal
 Invoke the method, showHomeMeal()

Delivery Address Meal Set Price District Delivery Fees
123 Thomson Close Dinner Premium Set A 123.50 450 20.00
45 Scotts Road Dinner Super Premium Set A 450.00 123 5.000
Can someone help me on this question?

Yes, but only if you make a mistake. Therefore, you have to think, write code and show it to us first. Then we can help you with your mistakes.
@futurefelicia001
Send me a private message.
Topic archived. No new replies allowed.