I'm doing a question which includes a DineInMeal class, HomeDelivery Class and a HomeMeal class. The DineInMeal class is to instantiate a specific set meal and the price, and display the members. The HomeDelivery class is to insantiate the district of the delivery and the delivery fee and display the members. The HomeMeal is to instantiate the address and the total charge of the price of the meal and the delivery fee. I've been able to complete both the DineInMeal and HomeDelivery class. However, for the HomeMeal class, I couldn't figure out how to calculate the price of the set meal and the delivery fee which is here inherited from the previous two classes. I have tried quite several times but there is some sort of an error. Can anyone help me?
firedraco's point was that line 20 is not a function call. It is actually a function prototype.
Do NOT include argument types in a function call.
The line should be:
homemeal header lines 8, 11-12: You both inherit DineInMeal and HomeDelivery and have them as member variables. This is wrong. Consider the IS A and HAS A rules. If a HomeMeal IS A DineInMeal and IS A HomeDelivery, then inheritance is correct and you should NOT have them as member variables. If a HomeMeal HAS A DineInMeal and HAS A HomeDelivery, then construction is correct and inheritance should not be used.