Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

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.

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92065409
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

Read the article titled 2016 oil and gas trendslocated at

Read the article titled "2016 Oil and Gas Trends",located at http://www.strategyand.pwc.com/trends/2016-oil-and-gas-trends. Next, argue for or against this statement: A company should determine its goals and values befor ...

The saying when in rome as the romans is part of todays

The saying, "When in Rome, as the Romans" is part of today's society's vernacular. Would be inclined to use this as your guiding principle in regards to ethical behavior in the work place? Why or why not?

Government policies can give indias biotech industry an

Government policies can give India's biotech industry an opportunity to enter a market segment. What specific policies favor the biotech industry? How do these links back to the Porter Diamond?

What is norways global health issues and how can they be

What is Norway's global health issues and how can they be combated?

Business plan evaluation access the internet and locate a

Business Plan Evaluation Access the Internet and locate a business plan for an enterprise that is similar to one that you are interested in developing. Write a two-page analysis report that addresses the issues below and ...

Instructor instructorname instructoremail biography

INSTRUCTOR (InstructorName, InstructorEmail, Biography, Specialty) TIMETABLE (SessionID, DayAndTime, NumberOfPlaces, ClassName, VenueName, InstructorName) Give the SQL to record the fact that all the sessions of the Cycl ...

Whats the difference between anbspbigfile tablespacenbspand

What's the difference between a  Bigfile tablespace  and a  Smallfile tablespace?  Explain which you would use for your database and why.

What do you think facebooks social responsbility should be

What do you think Facebook's social responsbility should be to its users and the communitites that is serves?

Assessment 5 sensitivity analysisin a product-mix-problem

Assessment 5 Sensitivity Analysis In a product-mix-problem, X1, X2, X3, and X4 indicate the units of products 1, 2, 3, and 4, respectively, and the linear programming model is MAX Z = $15X1+$17X2+$18X3+$16X4 S.T. 1) 5X1+ ...

You have now had an introduction to organizational behavior

You have now had an introduction to organizational behavior, scientific management, the human relations school and other classical ways of looking at people in organizations. Focus your discussion on the following: What ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As