Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Study the Scenario below and answer the question ( s ) that follow: PizzaHut is a South African restaurant that specialises in selling pizza. They

Study the Scenario below and answer the question(s) that follow:
PizzaHut is a South African restaurant that specialises in selling pizza. They are in need of a system that
helps them to calculate the final amount a pizza should cost after adding various toppings. They have
approached you as a developer to develop the application for them.
You are required to create an application that calculates the total amount a customer should pay
after ordering pizza. Use the following classes:
A class that that has the following:
An array that stores the toppings of the pizza. The class should be able to store a
maximum of 10 pizza toppings.
The price for each pizza is $14(dollars), and each topping is $2(dollars).
The class should also have a toString() method that displays the description and price of I
the pizza.
A subclass that inherits from Pizza but adds a numeric delivery fee and a String delivery
address. The delivery fee is $3 if the Pizza ordered costs more than $18; otherwise, the
delivery fee is $5.
Create a program that asks the user for toppings of the pizza. The user should continually
enter the toppings until a sentinel value is entered or until the maximum number of toppings
i.e.10 is reached.
Also ask the user whether the Pizza is to be delivered. If it is to be delivered create an object
for delivery then, display all the values for the pizza otherwise just display the values without
the delivery fee
Use Exception Handling where necessary.
Below is a sample of an output program:
Output , Run (testing)
D Compiling 4 source files to C:\Users muteplOneDrive\Documents NetBeansProject
-- exec:3.1.0:exec (default-cli)
a testing
Enter topping cheese
Enter topping or Q to quit tomato
Enter topping of Q to quit Q
Is this for delivery? Y or NY
Enter delivery address ( Concorde rd east
cheese, tomato pizza Price: 518.0
Deliver to: (Concorde rd east. Eee 13 $5.0

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_2

Step: 3

blur-text-image_3

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

What factors infl uence our perceptions?

Answered: 1 week ago