subject

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.
4, Inside the main() method of Simulator, create an instance of a Car object, and invoke 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 at least the following states and behaviors: 1, condition - an integer that represents the remaining durability of the part (starts at 100, goes down to 0 when the part is broken) 2, status () - a method that prints the condition of the part to the console. 2, The CarPart class should also implement a Functional interface, which declares a method "function()". 3, Each subclass of CarPart should have at least one state unique to that part (like the number of cylinders in an engine, or the fuel level of a fuel tank). Each subclass should also implement the inherited function() method to print a unique message to the console that incorporates the variables unique to that class. If you create any custom methods, you should NOT invoke those methods directly from the car or Simulator class. Those methods (if you write them) should be called from the overriden function () or status () methods. Make sure that your car class creates an instance of each CarPart subclass, as part of its constructor. These instances should be added to a collection of CarPart reference variables. 5, The run() method of your car class should iterate through the car's collection of CarPart references, which stores the instances of the CarPart subclasses. On each iteration, the function() method of the current object in the collection should be invoked.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
Answers: 1
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
You know the right answer?
1, Create a Java project in eclipse, called "PracticeCar" 2, Create a class called "Simulator", wit...
Questions
question
Social Studies, 15.01.2021 18:10
question
Mathematics, 15.01.2021 18:10
question
English, 15.01.2021 18:10
question
English, 15.01.2021 18:10
Questions on the website: 13722367