Answered step by step
Verified Expert Solution
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 questions 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 pizza toppings.
The price for each pizza is $dollars and each topping is $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 $ if the Pizza ordered costs more than $; otherwise, the
delivery fee is $
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
ie 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 source files to C:Users muteplOneDriveDocuments NetBeansProject
exec::exec defaultcli
a testing
Enter topping cheese
Enter topping or to quit tomato
Enter topping of to quit
Is this for delivery? or
Enter delivery address Concorde rd east
cheese, tomato pizza Price:
Deliver to: Concorde rd east. Eee $
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started