Implement the design of the Pizza class so that the following output is  produced: [Your code should work for any number of parameters added in the  set_toppings_info method] # Write your codes here. print("Pizza Count:", Pizza.pizza_count) print("=======================") p1 = Pizza("Chicken") p1.set_toppings_info(25, 1, 4, 0) p1.display() print("------------------------------------") p2 = Pizza("Olives") p2.set_toppings_info(15, 1.5, 0, 0) p2.display() print("------------------------------------") p3 = Pizza("Sausage") p3.set_toppings_info(50, 5, 2, 0) p3.display() print("=======================") print("Pizza Count:", Pizza.pizza_count) Output: Pizza Count: 0 ======================= Toppings: Chicken 25  calories 1 g fat 4 g protein 0 g carbs ------------------------------------ Toppings: Olives 15  calories 1.5 g fat 0 g protein 0 g carbs ------------------------------------ Toppings: Sausage 50  calories 5 g fat 2 g protein 0 g carbs ======================= Pizza Count: 3

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 7E
icon
Related questions
Question

Implement the design of the Pizza class so that the following output is 
produced:
[Your code should work for any number of parameters added in the 
set_toppings_info method]

# Write your codes here.
print("Pizza Count:", Pizza.pizza_count)
print("=======================")
p1 = Pizza("Chicken")
p1.set_toppings_info(25, 1, 4, 0)
p1.display()
print("------------------------------------")
p2 = Pizza("Olives")
p2.set_toppings_info(15, 1.5, 0, 0)
p2.display()
print("------------------------------------")
p3 = Pizza("Sausage")
p3.set_toppings_info(50, 5, 2, 0)
p3.display()
print("=======================")
print("Pizza Count:", Pizza.pizza_count)

Output:
Pizza Count: 0
=======================
Toppings: Chicken
25  calories
1 g fat
4 g protein
0 g carbs
------------------------------------
Toppings: Olives
15  calories
1.5 g fat
0 g protein
0 g carbs
------------------------------------
Toppings: Sausage
50  calories
5 g fat
2 g protein
0 g carbs
=======================
Pizza Count: 3

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Math class and its different methods
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,