Create a class named vehicle that acts as a super class for

Assignment Help Basic Computer Science
Reference no: EM13664806

Create a class named Vehicle that acts as a super class for vehicle types. The Vehicle class contains private variables for the number of wheels and the average number of miles per gallon. The Vehicle class also has a constructor with integer arguments for the number of wheels and average miles per gallon and a toString() method that returns a String containing these values.

Create two subclasses, Car and MotorCycle, that extend the Vehicle class. Each subclass contains a constructor that accepts the mile-per-gallon value as an argument and forces the number of wheels to the appropriate value-2 for MotorCycle and 4 for Car.

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

You need to submit original .java files (Vehicle.java, Car.java, MotorCycle.java, and UseVehicle.java) as an attachment to your initial response. (Please do not copy/paste the whole file code into your response.) Zip them into a single .zip file and attach the .zip file to your post. In the initial response itself, please provide comments and explanations of your solution with a proper UML diagram illustrating class hierarchy.

Reference no: EM13664806

Questions Cloud

The number of ways to fully-parenthesize : The number of ways to fully-parenthesize
A new yarn shop wants to apportion investment money : A new yarn shop wants to apportion their investment money ($150,000) for advertising, building upgrades, and education in the ratio of 7:8:10. How much money does each category get apportioned?
Download and complete the assignment writing assignment : Download and complete the assignment Writing Assignment
The number n on the upper face is recorded : A six-sided die is rolled and the number N on the upper face is recorded.
Create a class named vehicle that acts as a super class for : Create a class named Vehicle that acts as a super class for vehicle types
Write a 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.
Abc company order inventory system : ABC Company Order Inventory System
How many different colors could be represented with an rgb : How many different colors could be represented with an RGB scheme if only 3 bits were used to represent each RGB component (3 for R, 3 for G, 3 for B)?
Find how far up the incline does the sled move : In a circus performance, a monkey on a sled is given an initial speed of 5.0 m/s up a 30 m incline. Find how far up the incline does the sled move

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What are the differences between file viruses

1. What are the differences between file viruses, boot viruses, macro viruses, and network viruses?

  What is an "unbreakable" uml diagram

What is an "unbreakable" UML diagram. I have a Java assignment, and it's asking for this requirement, but I have never seen or heard of one.

  Write program that will calculate square and cube of numbers

Write a program that will calculate square and cube of numbers ranging from 0 to 10. Print the output like the following table (hint: use for loop, to print as a table use printf formatting for width).

  Hash function h is used and the signature

Suppose a hash function h is used and the signature must be valid for h(m) instead of m. Explain how  this scheme protects against existential forgery

  Cost benefits of technology

Cost Benefits of Technology

  Why is it important to have a body of standard job

Why is it important to have a body of standard job descriptions for hiing information security professionals?

  Write a matlab program

write a matlab program that asks the user to enter a positive number a between 2 and 10. Then create x and y vectors from -a and +a with spacing 0.05.

  Evaluate following integrals using simpson rule

Evaluate following integrals using simpson's rule and corrected simpson's rule (or richardson extrapolation in case the corrected simpson's is not applicable). In each case, use n = 2,4,8,16,32.

  Distinguish between software agents and pieces of software

How would you distinguish between software agents and other pieces of software? Is the electronic calendar like the one given by MS Office agent?

  Compare and contrast magnetic tapes

Realize business and organizational data storage and fast access times are much more important than they have ever been.

  When the jmpc field in the microinstruction is enabled

Assume that when the JMPC field in the microinstruction is enabled (set), MBR is ORed with NEXT_ADDRESS to determine the address of the next microinstruction to be executed

  When accessing the remote linux machine

When accessing the remote Linux machine

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