Writing Java Methods For The Following?
Anyone any good with Java? I got this in my homework and don't have a clue.
I need to write methods for the following.
In the TrafficLights class, complete the addLights() method as follows.
Change the state of the objects referenced by the method’s formal arguments as follows.
For the circle referenced by red:
• its colour should be set to red;
• its diameter should be set to 50;
• its x position should be set to 50 units more than the xPos of TrafficLights;
• its y position should be set to the same as the yPos of TrafficLights.
For the circle referenced by amber:
• its colour should be set to black;
• its diameter should be set to 50;
• its x position should be set to 50 units more than the xPos of TrafficLights;
• its y position should be set to 50 units more than the yPos of TrafficLights.
7
For the circle referenced by green:
• its colour should be set to black;
• its diameter should be set to 50;
• its x position should be set to 50 units more than the xPos of TrafficLights;
• its y position should be set to 100 units more than the yPos of TrafficLights.
|