Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class declaration for a class named Pizza that has the data members price, a double, and size, a Circle object (FROM 7.10 MINI-PROGRAMMING

Write a class declaration for a class named Pizza that has the data members price, a double, and size, a Circle object (FROM 7.10 MINI-PROGRAMMING PROJECT A). It also has member functions: setPrice() which sets the data member price, setSize() which sets the Circle data member, and costPerSqln() which returns the double value that is the cost per square inch of the pizza. Write the code for these as inline functions. Your Pizza class will also need to have a default constructor which has no parameters and sets the price to $5.00 and the size to a radius of 6. It will also have another constructor which accepts two parameters: P for price and S for size. Write a main() program that makes two Pizza objects to test out the two constructors. The main() program also needs to test out the setPrice(), setSize(), and costPerSqIn() member functions.

NOTE:

1. All in C++ , please add comments and provide a full screenshot of full code

2. PLEASE USE THIS CIRCLE CLASS DECLARATION that is provided below...

class Circle{ public: Circle(); // Default constructor with no parameters Circle(double rad); // Constructor that accepts a radius value void setRadius(double rad); // Sets the radius double calcArea(); // Returns the area of the circle double calcDiameter(); // Returns the diameter of the circle double calcCircumference(); // Returns the circumference of the circle double getRadius(); // Returns the value of the radius

private: double radius; };

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Describe the major legal cases focusing on competency

Answered: 1 week ago

Question

1. Describe the types of power that effective leaders employ

Answered: 1 week ago