Vehicles class to instantiate three objects making

Assignment Help Business Management
Reference no: EM131310787

Create a class named Vehicle that acts as a superclass for vehicle types. The Vehicle class contains private variables for the number of wheels and the average number of miles per gallon (MPG).  For each of these variables - create the proper get and set methods. The Vehicle class also contains a constructor with integer parameters for the number of wheels and average MPG. Create two subclasses, PassengerCar and Truck that extend the Vehicle class. The PassengerCar class will have an additional field  fuelTankCapacity and the method MaximumDistanceDriven, which calculate the maximum ride distance using the proper  MPG and fuel tank capacity values. The Truck class has the additional cargoLoad field. Each subclass contains a constructor that accepts the MPG value and forces the number of wheels to the appropriate values - 4 for a PassengerCar and 8 for a Truck. The PassengerCar constructor also accepts fuel tank capacity value, and the Truck constructor accepts the cargo load value. All classes contain appropriate get and set methods for each newly added field.

Write a Use Vehicles class to instantiate three objects making use of proper overloaded class constructors: one object of the Vehicle class, one object of the PassengerCar class and one object of the Truck class. When doing so, accept the user input and provide proper values for each the fields of each object (use Scanner of JOptionPane classes to implement a user's input).

Display the content of every data field in the newly created object: the number of wheels and average number of miles per gallon values for the Vehicle object; the number of wheels, miles per gallon, fuel tank capacity and maximum distance driven for a passenger car; number of wheels, average number of miles per gallon and cargo capacity for a Truck object.

Reference no: EM131310787

Questions Cloud

Determine the temperature of the ambient air : A ''cooling bag,'' commonly used for storing water in hot, arid environments is made of a thin porous fabric.- Determine the temperature of the ambient air using mass-transfer considerations.
Identify and describe the stages of team development : Identify and describe the stages of team development.How might stronger team skills benefit you? How might you use teamwork skills in your job? Provide specific examples.What is it like to participate in a virtual meeting, such as web-based, teleconf..
Calculate the pressure indicated by the probe : An impact probe is exposed to an airflow stream at 0?C, 20 kPa, and 600 m/s. What pressure will be indicated by the probe at a zero yaw angle?
Summarize the group communication competencies survey : Summarize the Group Communication Competencies Survey.Write a summary of your results and ways to improve your competency.
Vehicles class to instantiate three objects making : Write a Use Vehicles class to instantiate three objects making use of proper overloaded class constructors: one object of the Vehicle class, one object of the PassengerCar class and one object of the Truck class. When doing so, accept the user inp..
What pressure will be indicated by the probe : Water flows in a 5-in-diameter pipe at 20?C with a mean flow velocity of 3 m/s. A sharp-edged orifice with a diameter of 2.5 in is to be used to measure the flow rate. What pressure differential would be indicated for a standard ASME installation?..
Prompts a user for the course information : Write an application driver UseCourse class with the main() method, which prompts a user for the course information (use Scanner class or JOptionPane).
Computers transmit simultaneously : With a bus topology, what technique is used to handle data corruption when two computers transmit simultaneously?
What would be the indicated pressure : A Pitot tube with a yaw angle of 10? is used for the airflow in Prob. 7.39. What would be the indicated stagnation and dynamic pressures? Express in units of Pa, lbf/in2, and inH2O.

Reviews

Write a Review

Business Management Questions & Answers

  Determine the change in the discount rate

Assume that for every 1 percentage-point decrease in the discount rate, banks borrow an additional $100. Determine the change in the discount rate required to achieve the planned change in the money supply.

  Round all computations to the nearest whole dollar

Compute the book value for each of the above mentioned assets at December 31, 2015 and 2016. Compute the income statement effects for 2015 and 2016 for each of the above mentioned transactions.

  United states economy during the 1950

What impact did the decrease in military spending have on the United States economy during the 1950's era?

  Show the location based mobile networking

Location based mobile networking - What technological developments have set the stage for the growth of sense networks and the success of their products?

  Exchange rate in kenya with its effectiveness

Discuss the monetary policy and exchange rate in Kenya with its effectiveness, (1500-3000) words with references

  Prepare a career development plan for an organizationif you

prepare a career development plan for an organizationif you were charged with developing a career development plan for

  Hinder the delivery of health care

Health care has become to depend on information technology (IT) to deliver, monitor, and communicate health care delivery. Diiscuss the role IT has on the measuring and improving the quality of care being delivered. How will the electronic medical..

  Produce net benefits for the canadian

Nafta is likely to produce net benefits for the Canadian, Mexican, and US economy. Discuss. Would union members and consumers have the same view?

  Does management monitoring become unethical

Do you believe managers are justified in monitoring employees and should managers always alert workers about monitoring?

  Discuss the various levels of strategies the firm may use

Discuss various levels and types of strategies the firm may use to maximize its competitiveness and profitability. Outline a communications plan the company could use to make the strategies you recommend above known to all stakeholders.

  Reading of a collection of animal objects

Allow the reading of a collection of animal objects from an external file. Output on screen the content of a collection of animal objects. Use Iterator to achieve these goals.

  Human activity and climate change

In 3-4 pages, using APA-style formatting, discuss and give your position on the following statement: "Human activity, especially the burning of fossil fuels, is a major contributor to climate change".

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