( --> )

Object Construction and Use (Problems)

Tasks

  1. Print the area of the given triangle or the
    given rectangle, whichever is larger.

  2. Declare a variable named square and assign it
    a square whose side equals the diagonal of the
    given rectangle.

  3. Without using a selection statement, assign b
    the boolean value true if the the polygon denoted
    by p represents an octagon, and false if it
    represents another kind of polygon.

  4. Display, unlabelled, assuring no subsequent
    output on the line, the area of the pentagon
    which inscribes the given circle.

  5. Imagine a six sided white die with black dots.
    One side has one dot, another has two dots,
    and so on. Suppose that s represents one
    of the faces. Further, suppose that d represents
    one of the dots. Declare a variable called
    wsa and assign it the white surface
    area of the six sided, many (count them in
    your head) black dotted die.