Reference no: EM13161616
Your missions is to create the class Airplane. Each Airplane object should store the following information (fields):
manufacturer
modelNumber
maximumSpeed // in knots
maximumFuel // in gallons
grossWeight // in lbs
emptyWeight
Each airplane object should have the following behaviors (methods):
public float usefulLoad() // this is the grossWeight - emptyWeight
public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.
public void draw( Graphics g ) // this method will make a line drawing of an airplane. You don't have to get fancy. Do use drawString() to display the Airplanes information.
You will also need a constructor to initialize the fields.
You will need to put the GraphicsFrame, Drawable, Airplane, and the test driver all in one folder. The files need to 'see' each other. You can just add on the the test driver for the example.
Some starter code for the Airplane class:
public class Airplane implements Drawable
{
// fields
// constructor or constructors
// general methods
}