When piloting an aircraft, it is necessary to know the weight and center of gravity of the aircraft before takeoff. If the aircraft is overloaded, it may be difficult or impossible to achieve lift. If the center of gravity is outside of the designated limits, the aircraft may be difficult to control.



Write a program to determine the total weight and center of gravity of an aircraft, based on the number of crew members (a maximum of two is allowed; weight is greater than 150 and less than 210) and the weight of the cargo (a maximum of 5000 pounds is allowed). To compute the center of gravity, the program will take each weight and multiply it by its distance from the nose of the airplane. These products, called moments, are added together, and the sum is divided by the total weight to give us the empty center of gravity.

Given:

Empty weight of the aircraft = 9021 pounds

Empty center of gravity of the aircraft = 305 inches from the nose of the aircraft

Fuel = 540 gallons (assume that tank is full at takeoff time)

Fuel weight = 6.7 pounds per gallon

Fuel moment = 1169167.3

Distance from nose of aircraft to the crew seats = 120 inches

Distance from nose of aircraft to cargo bay = 345 inches



Implementation:

Validate cargo weight, number of crew and crew weight.

Use at least 2 non-void functions.



Sample run:



Enter number of crew members (maximum of 2) 2

2 crew members, thank you

Enter weights of crew members (min of 150 and max of 210):

160 160

320 lbs for crew members, thank you

Enter weight of cargo (maximum of 5000 lbs) 100

100.0 pounds of cargo loaded. Thank you



The total weight is 13059.0 pounds

The center of gravity is 305.802 inches from the nose of the plane.

    • 12 years ago
    complete solution
    NOT RATED

    Purchase the answer to view it

    • aircraft.cpp