|
|
|
|
|
|
|
Print Warning (No parameters) |
|
|
|
|
|
|
|
|
Print a warning message about the assumptions of the program and when to double-check the results |
|
|
|
|
|
|
|
|
|
In the following chart, you'll see a new notation. The box corresponding to each value-returning function has an upward arrow originating at its right side. This arrow signifies the function value that is returned. |
|
|
|
|
|
|
|
|
Here is the program that implements our algorithm. |
|
|
|
|
|
|
|
|
//******************************************************************
// Starship program
// This program computes the total weight and center of gravity
// of a Beechcraft Starship-1, given the number of crew members
// and passengers, weight of closet and baggage compartment cargo,
// and gallons of fuel loaded. It assumes that each person
// weighs 170 pounds, and that the fuel weighs 6.7 pounds per
// gallon. Thus, the output is approximate and should be hand-
// checked if the Starship is loaded near its limits
//******************************************************************
#include <iostream.h>
#include <iomanip.h> // For setw() and setprecision()
|
|
|
|
|
|