[Solved] Practice Car

$25

File Name: Practice_Car.zip
File Size: 113.04 KB

SKU: [Solved] Practice Car Category: Tag:
5/5 - (1 vote)
  1. Create a Java project in eclipse, called PracticeCar
  2. Create a class called Simulator, with a main() method.
  3. Create a Car class, with a run() method. The main() method of Simulator will create an instance of a car object, and call that objects run() method.

Now, you will create additional classes that represent the different components of a car the engine, the fuel tank, the wheels, etc. These classes should have methods related to their behaviors, and properties representing their various states (an engine is running or not, tires have levels of wear, etc).

  1. Every class representing a car part should inherit from a superclass called CarPart. The CarPart class will have all of the states and behaviors that are shared by all types of car parts (like condition and the ability to print a diagnostic report).
  2. Make sure that your Car class creates an instance of each CarPart subclass, as part of its constructor. Parts that a car has multiples of (like wheels) should be stored in a collection.
  3. Make sure that the run() method of the Car class does something with each instance of a CarPart subclass.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Practice Car
$25