Answered step by step
Verified Expert Solution
Link Copied!

Question

00
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 $10.00, medium is $14.00, and large is $17.00. Each topping costs $2.00.
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 $3.50 if the pizza ordered costs more than $20.00 or $5.00 for any pizza that is $20.00 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 pick-up 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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions