Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program has to be in C++ and header.h, Implementation.cpp and Testing.cpp Create a class named Pizza that stores information about a single pizza. It

This program has to be in C++ and header.h, Implementation.cpp and Testing.cpp

Create a class named Pizza that stores information about a single pizza. It should contain the following: Private instance variables to store the size of the pizza(either small, medium, or large), the number of cheese toppings, the number of pepperoni toppings, and the number of ham toppings Constructor that set all of the instance variables Public methods to get and set the instance variables A public method named calcCost() that returns a double that is the cost of the pizza Pizza cost is determined by: small: $10 + $2 per topping medium: $12 + $2 per topping larger: $14 + $2 per topping A public method named getDescription() that returns a String containing the pizza size, quantity of each topping, and the pizza cost as calculated by calcCost() Write test code to create several pizzas and output their descriptions. For example, a large pizza with 1 cheese, 1 pepperoni ,and 2 ham toppings should cost a total of $22.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Please do by excel. Credit for work

Answered: 1 week ago

Question

List behaviors to improve effective leadership in meetings

Answered: 1 week ago