Question
Circle Class A circle is identified by its center coordinates and its radius, as shown in the figure below. In the main file create N
Circle Class A circle is identified by its center coordinates and its radius, as shown in the figure below. In the main file create N circles and implement a circle class whose specification is given below. You will need to write three files (Circle.h, Circle.cpp and Q2.cpp)
Your implemented class must fully provide the definitions of following class (interface) functions. Please also write down the test code to drive your class implementation.
class Circle{ private: // think about the private data members... public: // provide definitions of following functions... Circle();// default constructor Circle(int x, int y); Circle(int x, int y, int radius);
//you have to implement the following functions // think about the parameters required and return type of the following functions setCenter();//set center of a circle setRadius();//set radius of a circle getArea();//prints area of a circle returnLargestCircle();//return the largest circle from the array of circles overlapping();//determines of two circles are overlapping or not overlappingCircles();//returns an array of circles overlapping the largest circle ~Circle(); }; int main(){ /you to create N circle objects and give user options to initialize them }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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