5  Lab Wednesday am:

Design recipes and methods for composition

Methods for composition

(10.1.1, 10.1.2)

Recall the problem of writing a program that assists a book store manager (see exercise 2). Develop the following methods for this class:

Exercise 2 provides the data definition for a weather recording program. Develop the following methods:
  1. withinRange that determines whether today's high and low were within the normal range;

  2. rainyDay that determines whether the precipitation is higher than some given value;

  3. recordDay that determines whether the temperature broke either the high or the low record;

  4. warmerThan that determines whether one day was wormer than another day;

  5. lowerRecord that determines whether the record low for one day was lower than for some other day. Solution