Create a class named MELTING SPOT that stores information about single pizza. It should contain the following: • Private variables to store the size of pizza (“small”, “medium” or “large”), the number of cheese topping and number of pepperoni toppings and the name of the shop. • Public method to set the data for pizza like size, and number of cheese and pepperoni toppings. • Public method named calculate Cost() that calculates the cost of pizza. • Pizza cost is determined by: Small: 10 $ + 2$ per topping Medium: 12$ +4$ per topping Large: 14$+ 6$ per topping Create 3 – 4 pizza objects and display their final cost and the name of name of the shop. For example, a small pizza with 2 cheese toppings and 3 pepperoni toppings at melting spot costs around 20$.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

Create a class named MELTING SPOT that stores information about single pizza. It
should contain the following:
• Private variables to store the size of pizza (“small”, “medium” or “large”), the
number of cheese topping and number of pepperoni toppings and the name of
the shop.
• Public method to set the data for pizza like size, and number of cheese and
pepperoni toppings.
• Public method named calculate Cost() that calculates the cost of pizza.
• Pizza cost is determined by:
Small: 10 $ + 2$ per topping
Medium: 12$ +4$ per topping
Large: 14$+ 6$ per topping
Create 3 – 4 pizza objects and display their final cost and the name of name of
the shop. For example, a small pizza with 2 cheese toppings and 3 pepperoni
toppings at melting spot costs around 20$.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage