[SOLVED] Practice Car

25.00 $

Categories: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon PracticeCar.zip (1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
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 object’s 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.
  • PracticeCar.zip