Skip to main content

18.2) Exercise 29


  1. Modify your solution to Exercise 28 so that the Circle object is declared as const, e.g.
  2. const Circle c(x, y, radius);
    

    Try compiling the program. You should see errors.

  3. Make the methods of your Circle class const. Remember to add the const to the prototypes in circle.hpp and the method implementations in circle.cpp. Remember that the constructor cannot, by definition, be const. Compile the class implementation file, then try to compile your program.