Pass in the number of gallons on board

Assignment Help JAVA Programming
Reference no: EM13161453

This program 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

}

Reference no: EM13161453

Questions Cloud

Write a c function void print_triangle(int n) : Write a C function void print_triangle(int n) that prints a triangular pattern of asterisks of height n and width 2 * n + 1 with one asterisk in the first line, three in the second line, etc.,
Program to do the enciphering : Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.
Evaluate the ph during the titration : Calculate the pH during the titration of 100.0 mL of 0.200 M HCl with 0.400 M NaOH. First what is the initial pH (before any NaOH is added
How genotype and phenotype are determined in normal : Explain why phenotype of the cloned mammoth would be similar to the wooly mammoth and not to the elephant egg donor or surrogate elephant mother. Compare and contrast how genotype and phenotype are determined in normal sexual reproduction with how..
Pass in the number of gallons on board : 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.
What are the highest and lowest payments : What are the highest and lowest payments from the writer that the bookkeeper farmer team will accept for the 6th day?
Write a c program that asks for and reads in two integers : Write a C program that asks for and reads in two integers and then reports if one is a multiple of the other.
State what are the partial pressures of no2 and n2o4 : N2O4 is introduced into an empty 2.14L container, what are the partial pressures of NO2 and N2O4 after equilibrium has been achieved at 45 degree celsius? Pn2o4, Pno2=?
Create a chart listing animals from the different classes : Create a chart listing animals from the different classes of vertebrates at the National Zoo. Include one example from each class. You should find information about the common characteristics of animals classified in this phylum. Describe their di..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a class array that encapsulates an array

Write a class Array that encapsulates an array and provides bounds-checked access. The private instance variables should be int index and inarray[10]. The public members should be a default constructor and methods (signatures shown below) to provide ..

  Java program for real estate agent

Write down java program for real estate agent. Program must perform the following tasks: ask users for average house price for the each of past 5 years for single family residence of 1500 square feet.

  Write program in java to calculate interest

Write a program in java to do the following : the following data is stored for each customer in the bank: account number,average balance and number of transaction for each customer it is required to calculate the interest earn

  Create system in java using agile approach

You are a software manager in company which designs critical control software for aircraft. Create system in Java using agile approach with a user involved in the development team.

  Implementation of memory management

Implementation of memory management

  Write java program to store employee id number

Use employee data file called employees.txt should comprise at least 5 employee records. Each record stores employee ID number (six digits) last name, first name, middle inital,gender(m or f).

  Write program in java-calculate and display mortgage payment

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage.

  Understand actual communication with an smtp server

Understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  Implement avl tree

Implement AVL trees that allows both iterative traversal and recursive traversal.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Prepare a java simulation program

Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys should be random integers.

  Create a circle class

create acircle class, which has one field, the radius. the class should contains two constructors: a no-argument constructor that set the radius to zero, and a constructor that takes a parameter to set the radius.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd