Vehicle in vehicle.java

Assignment Help JAVA Programming
Reference no: EM13163510

Create a class called Vehicle in Vehicle.java with instance variables make (such as Ford, GM, Chrysler, Toyota, or Honda), year, and horsepower (200, 300, and 400). Add the necessary constructor and set and get methods. Then create classes Bus and Truck in program files Bus.java and Truck.java, respectively. Bus has an instance variable called numOfPassengers (1-50) and Truck has an instance variable called towingCapacity (0.5, 1.0, 2.0, or 3.0 tons). Both Bus and Truck inherit from Vehicle and contain their own toString methods for displaying all their attributes (including the inherited ones). Compile all three classes.

Modify Vehicle.java so that it includes an instance variable called milesPerGal. Both Bus and Truck have a method called calculateMPG. The formula for a bus's milesPerGal is 10000/numOfPassengers/horsepower, but for a truck it is 5000/towingCapacity/horsepower. Create a program called VehicleApp.java that displays all information about a specific bus and truck of your choice.

 

Reference no: EM13163510

Questions Cloud

. write down each interaction with smartphone : Consider your smartphone as a system and use its calendar to set a calendar event with a reminder for your birthday. Write down each interaction between you and your smartphone as a scenario. Record all the interactions, including any feedback the sm..
Following class definition : Given the following class definition, describe the type of variables used by the arguments and return values of the following member functions (values, pointers, or references):
Primary comparative financial statements : Based upon your analysis in part a, does teh company's liquidity appear to have increased or decreased during the most recent fiscal year?
Ordering a burrito at a fast food mexican restaurant : Draw an activity diagram for ordering a burrito at a fast food mexican restaurant (e.g. Chipotle or Qdoba)
Vehicle in vehicle.java : Create a class called Vehicle in Vehicle.java with instance variables make (such as Ford, GM, Chrysler, Toyota, or Honda), year, and horsepower (200, 300, and 400). Add the necessary constructor and set and get methods.
State hydrocarbons are often reacted with steam : Hydrocarbons are often reacted with steam to form H2, as shown for propane: C3H8(g) + 6 H2O(g) 3 CO2(g) + 10 H2(g) Calculate Kp for this reaction at a particular temperature
Determine the keq for the reaction of benzoic acid : Determine the Keq for the reaction of benzoic acid with 4-nitroaniline.
Compute the equilibrium pressure of br2 : below, 8.34 atm each of H2 and Br2 were placed into a 1.00 L flask and allowed to react: H2(g) + Br2(g) 2 HBr(g) Given that Kc = 86.7, calculate the equilibrium pressure of Br2.
Individual traffic light has at least three states (g.y,r) : Consider a traffic light system at a four-way crossroads (two roads intersecting at right angles) with a countdown timer, a crosswalk button, and a speaker that announces it's ok or not ok to walk

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java application prompt user to put in integer from keyboard

Write a java application that performs the following task: prompt user to put in an integer from the keyboard, search for the user input from the array created in step 1.

  Write java program to display results in java applet

Write down the java program which displays following results in java applet. Permits the user to enter three numbers (use JOptionPane for this) and prints out average of those value on screen.

  What makes a program easy to modify

Describe the order of magnitude of the code section using Big(O) notation and Explain the relationship between dynamic storage allocation and recursion.

  Write down ijvm code to remove top two words from stack

Write down IJVM code which will remove these top two words, multiply and put their product back on stack. You are allowed to use existing IJVM instructions only.

  Print the contents of the array

Prepare a second loop that prints the contents of the array

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

  Determine the decision of java

Determine the decision of Java as the platform to develop this program. Identify the Java-based technologies utilized in this project and analyze each of them. Then, provide discussion on the purpose of each of the Java-based technologies utiliz..

  User enter a series of numbers

Design a java program with a loop that lets the user enter a series of numbers. The user should enter - 99 to signal the end of the series. After all the numbers have been enter been entered, the program should display the largest and smallest number..

  Write a program that reads a set of floating-point

Write a program that reads a set of floating-point data values from the input.

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.

  Write a while loop that lets the user enter a number

1) Write a while loop that lets the user enter a number. The number should then be multiplied by 10, and stored in a variable called product. The loop should then iterate as long as product contains a value less than 100.

  Develop view for order number and order total in file

Develop a view named OrdTot. It comprises of order number and order total for each order currently on file. Order total is the sum of number ordered.

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