Scenes and Points
Leveling assignment for Object Oriented design

  • We want to represent a simple graphical world of simple two dimensional shapes
  • Shapes are:
    • Points, that have an x and y coordinate
    • Rectangles, defined by a point at top-left and a point at bottom-right
    • Circles, defined by a center point and a radius
  • Scenes, defined by including zero or more shapes

  • Define a class structure for each of those. You may use inheritence if you want.
  • The scene class should include methods as follows:
    • constructor
    • add shape
    • delete shape
    • count shapes
  • Write a main program that
    • Creates a scene with 2 rectangles and a circle
    • Adds an additional rectangle to the scene
    • Deletes the circle from the scene
    • Prints out a report showing how many shapes of each kind exist in the scene