Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write class declaration for a class named Pizza that has the data members price, a double, and size, a Circle object. It also has
Write class declaration for a class named Pizza that has the data members price, a double, and size, a Circle object. 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 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 set Price(), setSize(), and costPerSqln() member functions. Write class declaration for a class named Pizza that has the data members price, a double, and size, a Circle object. 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 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 costPerSqln() member functions.
Step by Step Solution
★★★★★
3.49 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Heres the class declaration for the Pizza class as described include include Define a Circle class to represent the size of the pizza class Circle pri...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