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

  Loops and files

Convert an algorithm using control structures into Java and write a while loop

  Java project

Prompt the user for an int between lower and upper boundary.

  Java-s ability to derive new fonts from existing ones

Find out where on your system these font libraries are located. When you do, please specify the operating system and the location (folder/directory) where you found them. Discuss Java's ability to derive new fonts from existing ones.

  Compilation and Execution - JAVA problem

Style marks are based on how your submitted code looks. Remember that good code is easily readable (and understandable) by someone who did not write it. For assignments, you should also include your name, student number, what course this is, what ass..

  Write java programming to show number of credits for course

Write the java programming to solve following problem. We are given a student's marks in Calculus 1, CS1, and Physics 1 (each mark being between 0 and 100) also number of credits for each course.

  Write java program which will permit user to make selection

Write the Java Program which will permit the user to make selection. You will present user with two options to perform, then you will perform action selected by user.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  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..

  Write a java applet for grade of gas in costco gas station

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Implement security so that all users can view the informatio

Implement security so that all users can view the information about the projects, but only authenticated users

  Implement the finite field gf

Write a program called "GF2.java" to implement the finite field GF(p n )where p is a prime number andn is a positive integer.You also need to write four methodsto realize.

  Write java program to print price of table-furniture company

Write down the Java program for furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany. Illustrate the price of table produced with chosen wood.

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