You are to create a software design that simulates a fast food restaurant. You w
ID: 3840030 • Letter: Y
Question
You are to create a software design that simulates a fast food restaurant. You will have food items (hamburgers, hot dogs, chicken sandwiches) and drink items (Coke, sprite, root beer). The drinks come in various sizes given in ounces (for example: 12, 24, 48). Food items will be assigned a price when they are created but this price can be changed by the employee taking the items will be assigned according to the size of the drink. Which of the following would be the best choice for the design of this system? Why? a. The design should include the following classes: Hamburger, HotDog, Chicken, Coke, sprite, and RootBeer. b. The design should include the following classes: FoodItem with Hamburger, HotDog, and Chicken extending FoodItem and DrinkItem with Coke, sprite, and RootBeer extending DrinkItem. c. The design should include the following classes: Item with FoodItem and DrinkItem extending Item: Hamburger, HotDog, and chicken extending FoodItem; and DrinkItem with Coke, sprite, and RootBeer extending DrinkItem. d. The design should include the following classes: FoodItem and DrinkItem. The individual types of food and drink are only description of the food or drink and should not be separate classes. e. The design should include the following classes: Item with FoodItem and DrinkItem extending them. The individual types of food and drink are objects that are instances of these classes, not separate classes.Explanation / Answer
Answer15) e
Because the Item class would be the base class and the FoodItem and DrinkItem
are the derived class which extends the base class Item.
And the individual types of food and drinks not the seperate class.
Instead, are the objects that are the instances of the base and derived class.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.