< previous page page_443 next page >

Page 443
    }
    if (passengers > 4)                    // For passengers 5 and 6
    {
        moment = moment +
                 float(passengers - 4) * PERSON_WT * ROW3_DIST;
        passengers = 4;                    // 4 remain
    }
    if (passengers > 2)                    // For passengers 3 and 4
    {
        moment = moment +
                 float(passengers - 2) * PERSON_WT * ROW1_DIST;
        passengers = 2;                    // 2 remain
    }
    if (passengers > 0)                    // For passengers 1 and 2
        moment = moment +
                 float(passengers) * PERSON_WT * ROW2_DIST;
    return moment;
}

//******************************************************************

float CargoMoment( /* in */ int closet,     // Weight in closet
                   /* in */ int baggage )   // Weight of baggage

// Computes the total moment arm for cargo loaded into the
// front closet and aft baggage compartment

// Precondition:
//     0 <= closet <= 160  &&  0 <= baggage <= 525
// Postcondition:
//     Function value == Cargo moment arm, based on the closet and
//                       baggage parameters

{
    const float CLOSET_DIST =182.0;     // Distance from front
                                        //   to closet
    const float BAGGAGE_DIST = 386.0;   // Distance from front
                                        //   to bagg. comp.

    return float (closet) * CLOSET_DIST +
           float(baggage) * BAGGAGE_DIST;
}

//******************************************************************

 
< previous page page_443 next page >