Write a usevehicle class to instantiate one vehicle object

Assignment Help Basic Computer Science
Reference no: EM13664805

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: EM13664805

Questions Cloud

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
Find the resistance of this device : A calculator is rated at 0.17 W when connected to 4.40 Volt batteries. Find the resistance of this device

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a program prompts user to enter the first digits

Need help to write problem displaying ISBN(international standard book numbers). Question as follows:

  What normalization is used for and why

What normalization is used for and why

  Can you explain what is throw try and catch

Can you explain what is throw, try and catch

  Make sure the formatted string contains only 2 digits

Make sure the formatted string contains only 2 digits following the decimal point. Store the formatted string into a String variable called str.

  Write an ebnf rule that describes the while statement

Write an EBNF rule that describes the while statement of C++. Write the recursive-descent subprogram in C++ for this rule.

  Difference between a permanent address and a care-of address

How big is the MAC address space? The IPv4 address space and what is the difference between a permanent address and a care-of address? Who assigns a care-of address?

  Allocate new memory and release unneeded old memory

During an exec call in Minix, it tests for an adequate hole before releasing the current process memory. Reprogram this algorithm to do better.

  Evaluate the type of applications that the msmp

assignmentincreasing the number of cpus in a computer system tends to increase system performance. there are different

  Create a monthly claim status summary report

What data validation check would the clinic need for the new patient data entry screen? Write a brief memo with your recommendations.

  Design a plan for email content which was leaked

Suppose that you feel that your (or your boss's) email content was always leaked (e.g., some confidential information in your email was known to many others). Design a plan for this investigation.

  What do you consider the two most important software innovat

identify and describe what you believe to be the two most important hardware innovations.

  Discuss fault tolerance approaches

Windows server software works seamlessly with most hardware vendors that offer fault tolerant systems. Discuss fault tolerance approaches that systems managers use to assure continuity of operations. 200 words minimun plus references.

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