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

  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 an array where the user can input 7 temperatures

Write an array where the user can input 7 temperatures; include a 'for' loop. Make sure the temperatures are larger than -100 and smaller than or equal to 120, if not, make sure the user enters a valid number. Make sure the temperature is between the..

  Dijikstra for undirected graph using simple scheme

Dijikstra for undirected graph using simple scheme with array and fibonacci heap and compare the performance/results, preferably in java.

  Development of a simple program involving multiple classes

Development of a Simple Program Involving Multiple Classes and development of a basic Class, development of the Country and World classes

  Write java program to read in sequence of hourly temperature

Write down Java program which reads in sequence of hourly temperature readings over 24-hour period using arrays. Your program must find and show maximum and minimum temperatures.

  Build the gui layout of the game

Build the Build the GUI layout of the game in java.

  Evaluate the rtas resource requirements

Design and implement a set of classes and interfaces and use them to evaluate the RTA's resource requirements.

  Writing a program that parses

The programming project involves writing a program that parses, using recursive descent, a GUI definition language defined in an input file and generates the GUI that it defines.

  Java program that will prompt the user to input a file

Write a Java program that will prompt the user to input a file (document) in order to count the frequency of each word. This program will display the frequency of each word sorted alphabetically or by frequency (depending on the preference of the use..

  Print the contents of the array

Prepare a second loop that prints the contents of the array

  Create a java program to calculate the circumference

Create a Java program based on the geometric shapes. The program should begin by prompting you for the shape you want to calculate the circumference.

  Create simulation by java language for single-server queue

Suppose that customer inter-arrival times are exponentially distributed and service times are normally distributed. Create simulation by java language for this problem and view all parametre?

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