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, 23.06.2019 14:30
Select the correct answer. what does it indicate when a website displays https instead of http? a. the website is secure. b. there is no secure sockets layer. c. the secure sockets layer is hidden. d. the website is not secure.
Answers: 1
question
Computers and Technology, 23.06.2019 21:10
Asample of 200 rom computer chips was selected on each of 30 consecutive days, and the number of nonconforming chips on each day was as follows: 8, 19, 27, 17, 38, 18, 4, 27, 9, 22, 30, 17, 14, 23, 15, 14, 12, 20, 13, 18, 14, 20, 9, 27, 30, 13, 10, 19, 12, 26. construct a p chart and examine it for any out-of-control points. (round your answers to four decimal places.)
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
How are roger williams, james oglethorpe, and william penn similar?
Answers: 3
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, 02.07.2019 07:30
Questions on the website: 13722360