The graphics frame class and the drawable interface

Assignment Help Basic Computer Science
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

}

 

 

Reference no: EM13161715

Questions Cloud

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),

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Which shipper service to choose for company

Your task is to choose the best shipper for company. Compare these shippers, like FedEx (www.fedex.com), UPS (www.ups.com), and the U.S. Postal Service (www.usps.gov).

  Explaining concept of internet-first printing presses-mass

A number of historians explain concept of the internet as parallel to concept of first printing presses - mass communication.

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Few techniques to incorporate to site

Did you know that you do not have to start from scratch if your site is not accessible? There are a few techniques you may incorporate to your site.

  Investigate project management body of knowledge

Investigate Project Management Body of Knowledge (PMBoK). Write a report on one of knowledge areas. Describe the task of understanding potential threats

  What networking-communications changes were in past decades

What networking and communications changes were introduced in the past decade (2000s), and what were their implications?

  Compare performance-one-level split-two-level unified cache

Compare the performance (using AMAT) of a one-level split cache and a two-level unified cache system. For the one-level split cache, suppose a hit takes 2 clock cycles.

  Determine throughput for file transfer form one host-another

Assume Host A wishes to send the large file to Host B. Suppose no other traffic in network, Determine the throughput for the file transfer?

  Computing effective cpi of computer

Workstation uses a 15-MHZ processor with claimed 10-MIPS rating to execute a given programme mix. Suppose a one-cycle delay for each memory access. Compute effective CPI of this computer ?

  Servlet to return randomly chosen greeting

Write a servlet that returns a randomly chosen greeting from a list of five different greetings.

  Why computer literacy has become fourth fundamental skill

Explain whether today, computer literacy (knowledge of how to properly use computer and its software applications) has become fourth basic skill.

  Project life cycle model to create game plan

Explain in scholarly detail how you would apply project life cycle model to create a game plan for developing different project.

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