17.7) Exercise 26
Write a header file called circle.hpp, defining a class called Circle
.
Give your class:
- Private instance variables called
centre_x
andcentre_y
, of typedouble
, representing the position of the circle’s centre - A private instance variable called
radius
, of typedouble
, representing the circle’s radius - A constructor that will accept initial values for the three instance variables
- Methods
get_x
,get_y
andget_radius
that each have no parameters and return adouble
value - Methods
area
andcircumference
that each have no parameters and return a double
Remember that you are writing method prototypes here, not implementations!