•float
RectArea( /* in */ float leftEdge, // Left edge
of
• // rectangle
• /* in */ float width ) // Width of
rectangle
•// Computes the
area of a rectangle that starts at leftEdge and is
•//
"width" units wide. The height is given by the value
•// computed by
Funct at the horizontal midpoint of the rectangle
•//
Precondition:
•// leftEdge and width are assigned
•//
Postcondition:
•// Function value == area of specified
rectangle
•{
• return Funct(leftEdge + width / 2.0) * width;
•}