Question

c. Ill only d. land ll only e. I, II and III Questions 15 and 16 refer to the following design problem. 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. 15. 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: Foodltem with Hamburger, HotDog, and Chicken extending Foodltem and Dtrinkltem with Coke, Sprite, and RootBeer extending Drinkltem. c. The design should include the following classes: Item with Foodltem and Drinkltem extending Item: Hamburger, HotDog, and Checken extending Foodltem; and Drinkltem with Coke, sprite, and RootBeer extending Drinkltem. d. The design should include the following classes: Foodltem and Drinkltem. The individual types of food and drink are only descriptions of the food or drink and should not be separate classes. e. The design should include the following classes: Item with Foodltem and Drinkltem extending ltem. The individual types of food and drink are objects that are instances of these classes, not separate classes. 16. The fast food restaurant also offers value meals. A value meal is drink and a food item at same time. A 10% discount off the full price of purchasing each separately is applied to the price of a valu meal. A deluxe value meal costs so 50 more than a value meal and includes apple pie for dessert. Which of
0 0
Add a comment Improve this question Transcribed image text
Answer #1

15)

option (a) is not correct choice because maintaining separate classes for each item is not good since multiple instances need to create every time.

option (b) is good choice but not correct since here common property for food item and drinks are missing.

option (c) is correct answer since here maintaining common property as name in Item class and then extending foodItem and DrinkItem to separate them.

option (d) is not correct since again same explanation. missing common property.

option (e) keeping all items as instances will reduce flexibility to create and use them.

So finally option (c) is best chioce

----------------------------------------------------------------------------------------------------------------------------------------------------------------
HERE IS THE DESIGN SAMPLE

class Item {
   String name;
   double price;
}
class FoodItem extends Item {
   int size;
   FoodItem (String name,double price,int size){
       super(name,price);
       this.size = size;
   }
}
class DrinkItem extends Item {
   int ounces;
   FoodItem (String name,double price,int ounces){
       super(name,price);
       this.ounces = ounces;
   }
}

Add a comment
Know the answer?
Add Answer to:
Questions 15 and 16 refer to the following design problem. You are to create a software...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using C++ Mr. Manager wants you to process orders for the Fast Greasy Food Shop. His...

    Using C++ Mr. Manager wants you to process orders for the Fast Greasy Food Shop. His customers have a few choices in what they order. The can order a hamburger for 1.00. It they want cheese it is an addition .50 and if they want bacon the additional amount is .75. They can also order a small or large drink for 1.10 and 1.60 respectively and small or large French fries for 1.20 or 1.75 respectively.    The user can only...

  • Question 1 The following excerpt provide a description of the strategy used by fast food chains...

    Question 1 The following excerpt provide a description of the strategy used by fast food chains in the U.S. to raise its sales A war is breaking out between McDonald's, Burger King, and Wendy'sand that's great news for consumers America's biggest fast-food chains are engaging in a new price war Wendy's just started offering a "4 for $4" meal that includes a junior bacon cheeseburger, four chicken nuggets, small fries, and a drink, all priced at $4. The Wendy's deal...

  • *****************USING JAVA AND JAVA FX ************** PLEASE READ THE INSTRUCTIONS BEFORE YOU GO AND DO IT...

    *****************USING JAVA AND JAVA FX ************** PLEASE READ THE INSTRUCTIONS BEFORE YOU GO AND DO IT SOME OTHER WAY... home / study / engineering / computer science / questions and answers / *****in java & java fx***** a restaurant wants ... Your question has been answered! Rate it below. Let us know if you got a helpful answer. Question *****IN JAVA & JAVA FX***** A restaurant wants an application that calculates a table’s bill. The design should include: Group Boxes,...

  • I NEED HELP with this. please create a UML diagram. I need a simple code to...

    I NEED HELP with this. please create a UML diagram. I need a simple code to solve the problem.   The ADT Bag is a group of items, much like what you might have with a bag of groceries. In a software development cycle, specification, design, implementation, test/debug, and documentation are typical activities. The details are provided in the rest of the document. ADT Bag Specification: (Note: You should not change the names of the operations in your program. This should...

  • Problem 2: Point of Sale System The McDowell Restaurant chain has asked you to write a...

    Problem 2: Point of Sale System The McDowell Restaurant chain has asked you to write a menu program for their new Fast-food service machines. Your program already prints the following menu like this: ********************************************************************** McDowell’s Restaurant ********************************************************************** Make your selection from the menu below: 1. Regular Hamburger $1.50 2. Regular Cheeseburger $1.75 3. Fish Sandwich $2.50 4. Half-pounder with cheese $2.75 5. French Fries $0.99 6. Large Soft Drink $1.25 *********************************************************************** Select 1, 2, 3, 4, 5, or 6 -----...

  • DESCRIPTION You have to design an e-commerce shopping cart. These require classes Item, Electronics, Food, Dress,...

    DESCRIPTION You have to design an e-commerce shopping cart. These require classes Item, Electronics, Food, Dress, Cart and Main. ITEM CLASS Your Item class should contain: Attributes (protected) String name - name of the Item double price - price of the item Methods (public) void setName(String n) - sets the name of Item void setPrice(double p) - sets the price of Item String getName() - retrieves name double getPrice() - retrieves price String formattedOutput() returns a string containing detail of...

  • Project overview: Create a java graphics program that displays an order menu and bill from a...

    Project overview: Create a java graphics program that displays an order menu and bill from a Sandwich shop, or any other establishment you prefer. In this program the design is left up to the programmer however good object oriented design is required. Below are two images that should be used to assist in development of your program. Items are selected on the Order Calculator and the Message window that displays the Subtotal, Tax and Total is displayed when the Calculate...

  • Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's ...

    Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's best friend owns a restaurant. That person is very bad at math and recently discovered that most customers have been significantly undercharged for meals. You have been approached to create a computer program that will accurately calculate bills for each customer. Kids, under 5, eat free. Teens and seniors get a 25% discount. Also, Food and beverage is taxed at 5%. No tax for anything...

  • Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's best...

    Please write this code in JAVA lang., thank you! Your spouse's cousin's nephew's dog's trainer's best friend owns a restaurant. That person is very bad at math and recently discovered that most customers have been significantly undercharged for meals. You have been approached to create a computer program that will accurately calculate bills for each customer. Kids, under 5, eat free. Teens and seniors get a 25% discount. Also, Food and beverage is taxed at 5%. No tax for anything...

  • eclipse java Oxygen Design a self-service fast food menu. Name your class FastFood. Create a test...

    eclipse java Oxygen Design a self-service fast food menu. Name your class FastFood. Create a test class based on the examples from chapter 4. Create a program to do the following. When you set up the program, save the java file to a folder named Chapter 04 Program. Console Welcome to the fast food order menu How may I help you Please place your order: НННН Please place your order Your order Your subtotal: $e.00 $e.00 Continue? (y/n): Y Please...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT