Skip to main content

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 and centre_y, of type double, representing the position of the circle’s centre
  • A private instance variable called radius, of type double, representing the circle’s radius
  • A constructor that will accept initial values for the three instance variables
  • Methods get_x, get_y and get_radius that each have no parameters and return a double value
  • Methods area and circumference that each have no parameters and return a double

Remember that you are writing method prototypes here, not implementations!