When I used to live in Westville in what is now KwaZulu-Natal in South Africa, I used to work in the Westville Theatre Club as a stage hand and lighting manager. As a lighting manager I had to install strips of lights in the theatre. We used two types of lights: incandescent and flourescent. All lights output an amount of light measured in lumens. Incandescent lights also output a significant amount of heat, while flourescent lights output almost no heat (none for the purposes of this labtask). The amount of heat output by an incandescent light is 87.4 times the lumens of the light. While flourescent lights are cool, they are also harder to control - they are always either "on" or "off", so are therefore less useful in the theatre where effect is required. Thus, in any theatre light strip, it is important to monitor the total light output, the total heat output, and the number of flourescent lights.
In some initial analysis, design, and implementation, I produced an abstract superclass Light.java (that you may not modify), and also a control program RunLights.java (that you may not modify). You must implement the classes that represent incandescent lights, flourescent lights, and light strips. The classes for incandescent and flourescent lights must extend my abstract class for lights. The class for light strips must use a ArrayList to hold the lights in the strip. With those completed, here's what a sample run should look like (with the keyboard input shown in italics) ...
geoff@sherman:MyCode> java RunLights ------------------------------------ Total lumens = 0.0 Flourescent = 0 Heat output = 0.0 ------------------------------------ (A)dd light, (R)emove light, e(X)it : a (F)lourescent or (I)ncandescent : f How many lumens : 1000 ------------------------------------ 0: Flourescent light of 1000 lumens Total lumens = 1000.0 Flourescent = 1 Heat output = 0.0 ------------------------------------ (A)dd light, (R)emove light, e(X)it : a (F)lourescent or (I)ncandescent : i How many lumens : 500 ------------------------------------ 0: Flourescent light of 1000 lumens 1: Incandescent light of 500 lumens Total lumens = 1500.0 Flourescent = 1 Heat output = 43700.0 ------------------------------------ (A)dd light, (R)emove light, e(X)it : a (F)lourescent or (I)ncandescent : f How many lumens : 800 ------------------------------------ 0: Flourescent light of 1000 lumens 1: Incandescent light of 500 lumens 2: Flourescent light of 800 lumens Total lumens = 2300.0 Flourescent = 2 Heat output = 43700.0 ------------------------------------ (A)dd light, (R)emove light, e(X)it : r Index of light to remove : 6 ERROR: No light at that index ------------------------------------ 0: Flourescent light of 1000 lumens 1: Incandescent light of 500 lumens 2: Flourescent light of 800 lumens Total lumens = 2300.0 Flourescent = 2 Heat output = 43700.0 ------------------------------------ (A)dd light, (R)emove light, e(X)it : r Index of light to remove : 0 ------------------------------------ 0: Incandescent light of 500 lumens 1: Flourescent light of 800 lumens Total lumens = 1300.0 Flourescent = 1 Heat output = 43700.0 ------------------------------------ (A)dd light, (R)emove light, e(X)it : x