Program: circle.cpp 1: Create a class Circle 2: Create two instances of the Circle class 1: Based on Program 13-1 in the textbook, create a class name “Circle” with the following declarations (hint: you can use PI=3.14): //Circle class declaration class Circle { private: double radius; public: void setRadius(double); double getRadius() const; double getArea() const; double getPerimeter() const; }; 2: Based on Program 13-2 in the textbook, create two instances of the Circle class, pizza1 and pizza2, which can have different size (radius). You should put your answers for Q1 and Q2 into one program.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
1: Create a class Circle
2: Create two instances of the Circle class
1: Based on Program 13-1 in the textbook, create a class name “Circle” with the following declarations (hint: you can use PI=3.14):
//Circle class declaration
class Circle
{
private:
double radius;
public:
void setRadius(double);
double getRadius() const;
double getArea() const;
double getPerimeter() const;
};
2: Based on Program 13-2 in the textbook, create two instances of the Circle class, pizza1 and pizza2, which can have different size (radius). You should put your answers for Q1 and Q2 into one program.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images