Write usevehicle class to instantiate one vehicle object

Assignment Help Other Subject
Reference no: EM13302484

Write a UseVehicle class to instantiate one Vehicle object, one Car object, one MotorCycle object, and display each object’s values.

I made up the other classes (Car.java, MotorCycle.java, and Vehicle.java)

Car.java: public class Car extends Vehicle

{

public Car(int wheels, int mpg)

{

super(wheels, mpg);

}

}

MotorCycle.java: public class MotorCycle extends Vehicle

{

public MotorCycle(int wheels, int mpg)

{

super(wheels, mpg);

}

}

Vehicle.java: public class Vehicle

{

public int wheels;

public int mpg;

public Vehicle(int wheels2, int mpg2)

{

wheels = wheels2;

mpg = mpg2;

}

public int getWheels()

{

return wheels;

}

public double getMpg()

{

return mpg;

}

public String toString(int mpg)

{

String vehicleString = "Number of wheels is: " + wheels + " mpg is: " + mpg;

return vehicleString;

}

}

Reference no: EM13302484

Questions Cloud

How much heat must be supplied to the gas : The volume of 9 mol of a monatomic gas is increased from 3 L to 6 L at constant pressure. The initial temperature of the gas is 31?C. How much heat must be supplied to the gas
Describe the digestion and absorption of dietary fat : Beginning with the mouth, describe the digestion and absorption of dietary fat. What is the final fate of fat in the human body?
What is the ethernet standard used in such a vlan : Explain in detail with the help of diagrams the CSMA/CD media access control technique used in Ethernet and write a report on your observations analyzing the data collected in previous step.
State the properties of the image : An object is located 75.0 cm in front of a mirror and on the principle axis. The mirror is concave with a radius of curvature 50.0 cm. State the properties of the image
Write usevehicle class to instantiate one vehicle object : Write a UseVehicle class to instantiate one Vehicle object, one Car object, one MotorCycle object, and display each object’s values.
Estimate orlando cost of equity in thailand : However, Orlando Co. is considering a stock offering in Thailand that is denominated in Thai baht and targeted at Thai investors. Estimate Orlando's cost of equity in Thailand that would result from issuing stock in Thailand.
Find formula for mutual inductance for loop-wire combination : A rectangular loop of N close-packed turns is positioned near a long straight wire, find the formula for the mutual inductance M for the loop-wire combination
Calculate the pressure inside a 2-mm diameter bubble : Calculate the pressure inside a 2-mm diameter bubble of water at 20°C and compare with the pressure inside a 2-mm diameter droplet of water at 20°C.
Unite women made the voices of lesbians public : The "Lavender Menace" action at the Second Congress to Unite Women made the voices of lesbians public in the movement for the first time. Who organized the action, and what was the name of the position paper they wrote for the conference?

Reviews

Write a Review

Other Subject Questions & Answers

  Decoding the new mtv-speak

In what ways does Leslie Savan, the author of "Decoding the New MTV-Speak" (137–138), poke fun at advertising? Why does she question the audience and the purpose of advertising?

  James-lange theory

You are walking through a store when you run into a friend you have not seen in a long time and whom you miss very much. According to the James-Lange theory, what might happen?

  Believe to be a planned crime

Do attorneys have a moral obligation, beyond that stated in the law, to protect others from what they believe to be a planned crime?

  Notion of social structure may mask systematic biasness

It is believed the notion of social structure may mask systematic biasness. Can you justify this statement in terms of social stratification giving the pros and cons of such a theory.

  Culture of poverty

The so-called "culture of poverty" does not exist where poor people

  True about demographic transition

Which of the following is true about demographic transition

  Changes in the environment in massachusetts

Describe two changes in the environment in massachusetts during the fallthat cause anamals to prepare for winter

  Types of feedback loops the project management team

Propose three (3) types of feedback loops the project management team can implement so that potential users of the new payroll system can provide advice, suggestions, and guidance to the team during project development and implementation.

  How the infection is spread-what are the symptoms

Although there are few reported cases of polio in the U.S., we have had recent issues of epidemics of measles and continue to see cases of hepatitis B. Research these two viral illnesses in the U.S. Based on your research, address the following conce..

  Social cognitive theory of growth and development

Skinner's theories are part of the foundation of the field of psychology. Analyze his social cognitive theory of growth and development.

  Skill variety-task identity-task significance and autonomy

Know Hackman and Oldman 5 job characteristics be able to give an example of how each could be improved for a server at a restaurant

  Childhood and early youth

Who would each of you say were the main inspirations of Malcolm X and Martin Luther King during their childhood and early youth?

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