Week 7: Exercises

1. Rectangle Class

Write a class Rectangle representing a rectangle in 2 dimensions. The class should support these operations:

2. Circle Class

Write a class Circle representing a circle in 2 dimensions. The class should support these operations:

3. Vector Class

Write a class Vector that represents a vector in n-dimensional space. (We partially implemented this class in the lecture.)

4. Date Class

Write a class Date representing a month and day. The class should support these operations: