< previous page page_441 next page >

Page 441
void GetData( /* out */ int& crew,         // Number of crew members
              /* out */ int& passengers,   // Number of passengers
              /* out */ int& closet,       // Weight of closet cargo
              /* out */ int& baggage,      // Weight of baggage
              /* out */ int& fuel       )  // Gallons of fuel

// Prompts for the input of crew, passengers, closet, baggage, and
// fuel values and returns the five values after echo printing them

// Postcondition:
//     All parameters (crew, passengers, closet, baggage, and fuel)
//     have been prompted for, input, and echo printed

{
    cout << Enter the number of crew members. << endl;
    cin >> crew;
    cout << Enter the number of passengers. << endl;
    cin >> passengers;
    cout << Enter the weight, in pounds, of cargo in the << endl
         <  closet, rounded up to the nearest whole number.
         < endl;
    cin >> closet;
    cout <<Enter the weight, in pounds, of cargo in the << endl
         <<  aft baggage compartment, rounded up to the << endl
         <<  nearest whole number. << endl;
    cin >> baggage;
    cout << Enter the number of U.S. gallons of fuel << endl
         <<  loaded, rounded up to the nearest whole number.
         << endl;
    cin >> fuel;
    cout << endl;
    cout << Starship loading data as entered: << endl
         <<    Crew:           < setw(6) < crew < endl
         <    Passengers:     < setw(6) < passengers < endl
         <    Closet weight:  < setw(6) < closet   pounds
         < endl
         <    Baggage weight: < setw(6) < baggage <  pounds
         < endl
         <    Fuel:           < setw(6) < fuel <  gallons
         < endl < endl;
}

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

float CrewMoment( /* in */ int crew )   // Number of crew members

// Computes the crew moment arm in inch-pounds from the number of

 
< previous page page_441 next page >