Write a program to store some details of pizzas (menu item number, size, base, extra cheese,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
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 ... View the full answer
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date:
Students also viewed these programming questions
-
Write a program to store an input list of ten integers in an array: then display a table similar to the following table, showing each data value and what percentage each value is of all ten values....
-
Write a program to compute word ladders where single-character substitutions have a cost of 1, and single-character additions or deletions have a cost of p > 0, specified by the user. As mentioned at...
-
Write a program to print Hello World 25 times without writing a single line in the main function except system(pause).
-
Consider a cube that has 5cm length sides. What is the surface area to volume ratio of this cube? Report your answer in cm/cm Report your answer to one decimal place. QUESTION 12 Consider a cube that...
-
Is it possible for two countries to have the same Gini coefficient but different distributions of income? Explain how you came to your conclusion.
-
Table 2.13 shows a data set containing information for 45 mutual funds that are part of the Morningstar Funds 500 for 2008. The data set includes the following five variables: Fund Type: The type of...
-
Evaluate the ways that censorship affects the arts in different cultural contexts.
-
The actual demand for the patients at Omaha Emergency Medical Clinic for the first six weeks of this year follows: Week Actual No. of Patients 1 ............ 65 2 ............ 62 3 ............ 70 4...
-
Write a MIPS program that asks the user for a string of 30 ASCII characters or less. Store the input in an array called buffer. If the user does not enter any characters (only presses the enter key),...
-
Ivanhoe Coffeeshop began operations April 1. At April 30, the trial balance shows the following balances for selected accounts: Prepaid Insurance Equipment Notes Payable Unearned Revenue Service...
-
Consider that the force of Interest Delta(t) is a function of time,t, and is given by the following formula: 0.08 for 0 < t < 16 and 0.09 0.0010 t fort > 16 Calculate the accumulated amount at time t...
-
Snow resorts are highly dependent on seasonal weather and suffer from low visitations during off-ski seasons. Discuss strategies on how ski resorts can manage demand during non-snow seasons. What...
-
Joondalup Resort has a world class golf course. While the resort provides accomodation and F&B services to their guest, a key part of their revenue stream comes from the golfing department. However,...
-
Here is a short story about Employment Discrimination: Bond James ("Bond") is a partner at International Services ("IS"), an international consulting firm with offices in Seattle, WA, Los Angeles,...
-
Benjamin's Production Company has recently suffered a large theft of production equipment during the filming of a movie. The theft was only discovered the next morning when he noticed that the...
-
Vicki teaches accounting courses at a community college. The college administration suspects that at least a few employees are improperly using their computers. Hidden cameras are installed around...
-
ges of the cells.) 18. A power company charges a city $1.2167 per street lamp per month. There are 1,125 street lamps supplied with current. What is the city's power bill per year for the street...
-
Refer to the situation described inBE 18-13, but assume a 2-for-1 stock split instead of the 5% stock dividend. Prepare the journal entry to record the stock split if it is to be effected in the form...
-
Write the remaining procedures to implement AVL single and double rotations.
-
Suppose we perform a breadth-first search of an undirected graph and build a breadth-first spanning tree. Show that all edges in the tree are either tree edges or cross edges.
-
Modify the splay tree to support queries for the kth smallest item.
-
Using the Wilson method with \(\theta=1.4\), solve Problem 11.20. Data From Problem 11.20:- The equations of motion of a two-degree-of-freedom system are given by \(2 \ddot{x}_{1}+6 x_{1}-2 x_{2}=5\)...
-
Using the Wilson method with \(\theta=1.4\), solve Problem 11.19. 2 618-10-050} 2 4x2 +5 F(t) 3 o
-
Using the Newmark method with \(\alpha=\frac{1}{6}\) and \(\beta=\frac{1}{2}\), solve Problem 11.18. Data From Problem 11.18:- Using the central difference method, find the response of the...
Study smarter with the SolutionInn App