Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c + + Create a class name Pizza with the following private data: a string for size ( small , medium, large ) ; a
c Create a class name Pizza with the following private data: a string for size small medium, large; a string type classic deep dish, thin crust; a vector of strings for toppings; and a double for price.
Include accessor functions for all private data.
Include a private function that will calculate the price of your pizza: small is $ medium is $ and large is $ Each topping costs $
Include a constructor that requires arguments for size, type, and the vector of toppings. Your constructor will call your private function to calculate price.
Overload the operator to display the pizza ordered formatting two decimal places for the price.
Create a derived class named DeliveredPizza that inherits from Pizza and contains a delivery fee, a total price, and delivery address. The delivery address is required in the constructor. The constructor will also calculate the delivery fee of $ if the pizza ordered costs more than $ or $ for any pizza that is $ or less and the total price.
Overload the operator to display the pizza order, including the delivery fee, the total price, and the address it will be delivered to Be sure to format two decimal places for the price.
Your main function will contain an array of topping selections: "Pepperoni", "Mushrooms", "Onions", "Green Pepper", "Tomatoes", "Jalapenos".
You will write a function that uses references that will ask the user for the pizza size, the crust type, and what toppings they would like see output
You will then ask if they want pickup or delivery. If they want delivery, ask for their address.
Create the appropriate pizza and use the overloaded insertion operator to display the details of their pizza.
Dont forget data validation!
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