On this page:
Readings
Supplemental Materials
Pre-lecture
Goals
In-class
Homework

Module 11

Last updated: Wed, 8 Apr 2015 15:29:36 -0400

Readings
Supplemental Materials
Pre-lecture
  1. Read the Readings and Supplemental Materials.

Goals
In-class

Define Circle%, Square%, and Composite% classes that implement the following Shape<%> interface.
(define Shape<%>
  (interface ()
    ; weight : -> NonNegReal
    ; Returns the weight of this shape, which is related to its area in Pixels.
    weight
 
    ; render : Image -> Image
    ; Returns an Image with this shape added to the given Image.
    render))
 
; A Pixels is a NonNegReal
 
; A Circle is a (new Circle% [x Coordinate][y Coordinate][r Pixels][c Color])
; Represents a circle.
 
; A Square is a (new Square% [x Coordinate][y Coordinate][l Pixels][c Color])
; Represents a square parallel to sides of a canvas.
 
; A Composite is a (new Composite% [front Shape<%>][back Shape<%>])
; Represents a group of two overlapping Shape<%>s.
Be sure to follow the OOP Style guide!

Homework

Problem Set 11