Now, you will create additional classes that represent the different components of a car - the engine,

4 answers
Question:

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:
2. condition - an integer that represents the remaining durability of the part (starts at 100, goes down to 0 when the part is broken)
3. status() - a method that prints the condition of the part to the console.
4. The CarPart class should also implement a Functional interface, which declares a method "function()".
5. 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. The CarPart subclasses should not define unique methods, unless those methods are called from their overriden function() or status() methods.
6. 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.
7. 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.

Answers

The Romans did not have a representative democracy.They elected the executive officers of state instead. All adult male Roman citizens had the right t

This is true. At first only the patrician families could participate in policy making but after a while there was high discontent between the classes and after a series of events the Plebeians also got political rights and were represented. The commoners who were not politically involved still had a hard time.

Yes every class was represented

Yes every class was represented in the roman republic of coures because without them we would not be herw in the us

Similar Solved Works

3 answers

When migration time was getting close, what changes started happening that told the birds it was time to go south or west? Use

When migration time was getting close, what changes started happening that told the birds it was time to go south or west? Use evidence from the chapter to support your thoughts. frightful...
3 answers

What might have happened to perseus if he had not received from the gods?

What might have happened to perseus if he had not received from the gods?...
4 answers

47 is the sum of 24 and craigs savings

47 is the sum of 24 and craigs savings...
4 answers

What type of positive business message does this paragraph convey?I’m the head of the human resources department at XYZ Technology. My company wants

What type of positive business message does this paragraph convey? I’m the head of the human resources department at XYZ Technology. My company wants to hire a manager for the research division. The candidate should have at least five years of experience in ceramic technology. If it is convenient...
3 answers

Which the exception of some sponges, all animals )coelomates b)autotrophs c)heterotrophs d)hermaphrodites

Which the exception of some sponges, all animals )coelomates b)autotrophs c)heterotrophs d)hermaphrodites...
4 answers

Study the image. a house on a beach near the ocean. point 1 is over the house, arrow is pointing up.

Study the image. a house on a beach near the ocean. point 1 is over the house, arrow is pointing up. point 2 is over the ocean, with arrows pointing away from the land. point 3 is over the ocean with the arrow pointing down. point 4 is in the ocean with arrows pointing toward land. what do the arrow...
4 answers

Purple (P) is dominant to white (p) in pea plants. Draw a punnett square cross between two heterozygous purple flowering plant.

Purple (P) is dominant to white (p) in pea plants. Draw a punnett square cross between two heterozygous purple flowering plant....
3 answers

Given: f(x) = 6x - 10 Evaluate 11

Given: f(x) = 6x - 10 Evaluate 11...
2 answers

I need help with this plz

I need help with this plz [tex]I need help with this plzzzzz[/tex]...
4 answers

Find the inequalities from their graphs ​

Find the inequalities from their graphs ​ [tex]Find the inequalities from their graphs ​[/tex]...
3 answers

How much money was spent on the 2016 presidential election?

How much money was spent on the 2016 presidential election?...
4 answers

An aquarium tank holds 169 gallons of water. how much is this in liters? use the following conversion:

An aquarium tank holds 169 gallons of water. how much is this in liters? use the following conversion: 1 gallon is 3.8 liters....
10 answers

What is 8+-67=what please help

What is 8+-67=what please help...
4 answers

I need some help here...

I need some help here... [tex]I need some help here...[/tex]...
3 answers

Why is el nido is beautiful to visit?​

Why is el nido is beautiful to visit?​...
4 answers

Explain each in at least one sentenceStep 1: Evaporation. The water cycle starts with evaporation. ...Step 2: Condensation.

Explain each in at least one sentence Step 1: Evaporation. The water cycle starts with evaporation. ... Step 2: Condensation. ... Step 3: Precipitation. ... Step 4: Transpiration. ... Step 5: Runoff. ......
3 answers

What happen if there is an increase of free hydrogen ion in the mitochdrin

What happen if there is an increase of free hydrogen ion in the mitochdrin...
3 answers

Asolution of 10% dextrose in water is hypertonic to human blood. what would happen if you were to infuse

Asolution of 10% dextrose in water is hypertonic to human blood. what would happen if you were to infuse a patient with this solution?...
10 answers

Hey can anyone pls pls pls help em out in dis rq i will mark u as brainliest

Hey can anyone pls pls pls help em out in dis rq i will mark u as brainliest [tex]Hey can anyone pls pls pls help em out in dis rq i will mark u as brainliest[/tex]...
3 answers

Which best describes point by point paragraph structure A. The author introduces each point followed

Which best describes point by point paragraph structure A. The author introduces each point followed by evidence and analysis of that point B. The author introduces the evidence in the topic sentence and backs it up with a list of points C. The author introduces all the evidence in concludes with t...

-- 0.016253--