I need to create a Circle.h file EXPECTED OUTPUT: Center: (0, 0) Radius: 1 Area:
ID: 3733538 • Letter: I
Question
I need to create a Circle.h file
EXPECTED OUTPUT:
Center: (0, 0)
Radius: 1
Area: 3.14159
Center: (1, 2)
Radius: 3
Explanation / Answer
class Circle{
private:
double x, y, r;
public:
double area;
Circle(){
x= 0;
y=0;
r = 1;
}
Circle(double x1, double y1, double r1) {
x = x1;
y = y1;
r = r1;
}
double getX() {
return x;
}
double getY() {
return y;
}
double getR() {
return r;
}
void setX(double x1) {
x = x1;
}
void setY(double y1) {
y = y1;
}
void setR(double r1) {
r = r1;
}
};
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.