Question: A java program to store some details of pizzas (menu item number, size, base, extra cheese, extra garlic), curries (menu item number, size, curry type)

A java 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.

the programme 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".

The use inheritance and polymorphism to model the Pizza, Curry and SoftDrink classes as subclasses of the same base class, which forms the basis for the array.

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

p

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

c

Enter the menu item number

456

Enter the size

Large

Enter the curry type

Vindaloo

Done

MENU: add (P)izza, add (C)urry, add (S)oft drink, (D)elete, (L)ist, (Q)uit

s

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, (Q)uit

l

Pizza: 123, 12", Hand-tossed, Yes, Yes

Soft Drink: 789, Large, Coke, Bottle

Done

MENU: add (P)izza, add (C)urry, add (S)oft drink, (D)elete, (L)ist, (Q)uit

q

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!