Reference no: EM13161715
This lab makes use of the GraphicsFrame class and the Drawable interface. 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.
Make sure you look at the example of GraphicsFrame. 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
}
Program should display a menu
: The program should display a menu allowing the user to enter pointer values by selecting option 1, then perform shallow or deep copy by selecting options 2 or 3. After whcich, your program needs to display the new results after the copy is performed.
|
Main program should instantiate an instance
: The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results
|
Delete all sub-directories within
: Delete all sub-directories within "temp" directory if not empty. In Python program change the current working directory to [temp].
|
Program that reads a series of whitespace
: Write a program that reads a series of whitespace delimited strings from stdin and prints them back out, separated by spaces, in lexicographic order. You may assume that all strings are lower case and that no string has more than 20 characters.
|
The graphics frame class and the drawable interface
: This lab makes use of the GraphicsFrame class and the Drawable interface. Your missions is to create the class Airplane.
|
After the array is created and loaded
: After the array is created and loaded, the problem is then to sort the array and print out the contents of the sorted array. Please use a separate function for the sort routine and also a separate function for the print out of the array.
|
The first will be a structure called point
: Create two structures. The first will be a structure called Point and will have as its data members an x and y coordinate. The second will be called Line and will have two Point structures as its data members.
|
Sorting routine adopted in the java api for arrays.sort()?
: What is the sorting routine adopted in the Java API for Arrays.sort()? How different is it from the sorting routine we discussed in class? Is it better? Explain your answers in short clear sentences.
|
Develop a class airborne location
: develop a class AirborneLocation that represents the location of airplanes with respect to a reference radar location. Each AirborneLocation object should include data member for aircraftID (integer),
|