Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to store some details of pizzas (menu item number, size, base, extra cheese, extra garlic), curries (menu item number, size, curry

  

Write a program to store some details of pizzas (menu item number, size, base, extra cheese, extra garlic), curries (menu item number, size, curry type) and softdrinks (menu item number, size, flavour, bottle or can) in a single array, with the options of listing all menu items or deleting a particular menu item. Your program must continuously prompt the user to choose an option from a list and act on that option, until the exit option is chosen. (See the sample output below.) If a menu item is not found, output "Not found" instead of "Done". You must use inheritance and polymorphism to model your Pizza, Curry and SoftDrink classes (use those exact class names) as subclasses of the same base class, which forms the basis for the array. Note: Be very careful to reproduce the output exactly. Copy-and-paste is highly recommended to avoid minor typographical errors that drive you crazy when submitting online! Sample Input/Output: Welcome to Great International Food Court MENU: add (P)izza, add (C) urry, add (S) oft drink, (D) elete, (L)ist, (Q) uit Enter the menu item number 123 Enter the size 12" Enter the base Hand-tossed Enter extra cheese Yes Enter extra garlic Yes Done MENU: add (P)izza, add (C) urry, add (S) oft drink, (D) elete, (L)ist, (Q)uit Enter the menu item number 456 Enter the size Large Enter the curry type Vindaloo Done MENU: add (F)izza, add (C) urry, add (S) oft drink, (D)elete, (L)ist, (Q) uit Enter the menu item number 789 Enter the size Large Enter the flavour Coke Enter whether it is a bottle or can Bottle Done MENU: add (P)izza, add (C) urry, add (S) oft drink, (D) elete, (L)ist, (Q) uit d. Enter the menu item number 456 Done MENU: add (P)izza, add (C) urry, add (S) oft drink, (D)elete, (L)ist, (0) uit 1 Pizza: 123, 12", Hand-tossed, Yes, Yes Soft Drink: 789, Large, Coke, Bottle Done MENU: add (F)izza, add (C) urry, add (S) oft drink, (D) elete, (L)ist, (Q) uit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

import javautil class Pizza class variables int menuItemNumber String base size boolean extraCheese extraGarlic constructor public Pizza int menuItemNumber String size String base boolean extraCheese ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Structures and Algorithm Analysis in Java

Authors: Mark A. Weiss

3rd edition

132576279, 978-0132576277

More Books

Students also viewed these Programming questions

Question

Modify the splay tree to support queries for the kth smallest item.

Answered: 1 week ago