Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

5 Discuss how companies can react to the marketing environment.

Answered: 1 week ago

Question

How many bytes a char data type occupies?

Answered: 1 week ago

Question

The intermediate code is referred to as?

Answered: 1 week ago

Question

A loop with in another loop is called a ?

Answered: 1 week ago

Question

Java interpreter is also known as ?

Answered: 1 week ago

Question

Which purpose a construction is used?

Answered: 1 week ago