C++ Question
I will give a thumbs up if problem gets solved correctly!!
Every circle has a center and a radius. Given the radius, we can determine the circle's area and circumference. Given the center, we can determine its position in the x-y plane. The center of a circle is a point in the x-y plane. Design the class Circle that can store the radius and center of the circle. Because the center is a point in the x-y plane and you designed the class to capture the properties of a point in Programming Exercise 3, you must derive the class Circle from the class Point. You should be able to perform the usual operations on a circle, such as setting the radius, printing the radius, calculating and printing the area and circumference, and carrying out the usual operations on the center.
Please proof the code and make the necessary corrections so it can compile/debug in Visual Studio 2019
main.cpp
01 | #include "pointType.h" |
02 | #include "circleType.h" |
12 | cout << "Enter the x and y coordinate " << endl; |
13 | cin >> Coordinate_x >> Coordinate_y; |
14 | cout << "Enter the radus of the circle" < |
16 | cout << "The X and Y Coordinates are: (" < |
18 | cout << "The Area if the circe "; |
19 | cout <, "The circumferance of the circke is "; |
pointType.cpp
01 | #include "pointType.h" |
04 | /*void pointType::setCoordinate(double x,double y) |
10 | void pointType::setCoordinate_x(double Coordinate_x) |
15 | void pointType::setCoordinate_y(double Coordinate_y) |
19 | void pointType::print()const |
24 | pointType::pointType() |
26 | double Coordinate_x= 0; |
27 | double Coordinate_y= 0 ; |
pointType.h
01 | #ifndef POINTTYPE_H_INCLUDED |
02 | #define POINTTYPE_H_INCLUDED |
11 | /*void setCoordinate(double x = 0, double y = 0);*/ |
12 | void setCoordinate_x(double Coordinate_x); |
13 | void setCoordinate_y(double Coordinate_y); |
14 | double getCoordinate_x () const; |
15 | double getCoordinate_y ()const; |
17 | pointType (double Coordinate_x,double Coordinate_y); |
26 | #endif // POINTTYPE_H_INCLUDED |
circleType.h
07 | class circleType : public pointType |
10 | void circleType(double Coordinate_x, double Coordinate_y,double Radus ); |
12 | double setAreaOfCircle() const; |
13 | double setCircumference() const; |
14 | double getRadus () const; |
15 | circleType(double Coordinate_x, double Coordinate_y,double Radus); |
16 | ~circleType (void);//rest is from defalut |
18 | virtual ~circleType(); |
25 | #endif // CIRCLETYPE_H |
src\circleType.cpp
01 | #include "circleType.h" |
02 | #include "pointType.h" |
06 | double circleType::getRadus()const |
10 | double circleType::AreaOfCircle () const |
12 | return 3.14 * Radus*Radus; |
14 | double circleType::Circumference () const |
19 | circleType::circleType() |
24 | circleType::~circleType() |