The Airplane Weight-and-Balance Program


Your task is to write a program than can compute the weight and balance for a Cessna-150.

Things to know about weight and balance in airplanes.

Every load in the airplane has a weight and an arm. The weight describes how much it weighs, and the arm describes if the load pushes the plane nose-heavy or tail-heavy. The product of the weight and the arm is called the moment. For example, if I weigh 170 lbs and sit 39 inches behind the propeller, them my weight is 170 lbs, my arm is 39 inches, and my moment is 6,630 lbs-inches.

Every plane has a weight limit. If the plane weighs more than it should, it will not be able to climb very well and will land too fast.  If the plane weights lots more than it should, the wings will fall off during maneuvering. The most my plane can weigh is 1,600 lbs.

Every plane has center of gravity limits. These describe how nose/tail heavy the plane can be and remain safe. On my plane, the center of gravity must remain between 31.3 and 37.4 inches behind the propellor or I will be in danger.

The Center of Gravity of a plane is just the sum of the moments divided by the sum of the weights.

The plane uses 6 gallons per hour. The plane flies 100 mph. Each gallon weighs 6 pounds. The tanks can only hold 21 gallons max.

Here is a sample weight and balance problem.

Item

Weight

Arm

Moment

Empty Plane

1067.9 lbs

32.94 inches

35,176 lb-inches

Me

205 lbs

39.0 inches

7995lb-inches

Fuel

132 lbs

39.5 inches

5,214 lb-inches

TOTAL

1404.9 lbs


48,385 lb-inches

Center of Gravity = 48,385 / 1,404.9 = 34.44 inches



Your task is to write a web page using Javascript that computes the weight and balance for a given flight. This assignment is out of 85,000,000 points.

Item

Points

Can compute the weight and center-of-gravity for a C-150

10,000,000

Alerts the user if the plane is over-weight

10,000,000

Alerts the user if the plane is out of balance

10,000,000

Shows a graph of the weight and balance

10,000,000

Complains about stupid entries (negative weight, people who weigh more than 300 lbs)

10,000,000

Uses CSS in a separate file

5,000,000

Has an appropriate embedded video

5000000

Has up and down buttons to change a field's value

5000000

Uses a table

5,000,000

A field changes color for any reason

5,000,000

Uses an if-else

5,000,000

Tells how far the plane can fly

5,000,000

Turned in during finals week

-10,000,000