Home /
Expert Answers /
Advanced Physics /
create-a-main-method-that-does-the-following-tasks-using-the-classes-shown-above-you-should-not-n-pa279
(Solved): Create a main method that does the following tasks using the classes shown above. (You should not n ...
Create a main method that does the following tasks using the classes shown above. (You should not need any more details about the classes other than what is provided in the UML diagram and the steps below.) 1. Define an array of 3 doubles: 10.5, 15.5, and 25.7. These will represent the fan speeds. 2. Make a variable of type Fan and instantiate the variable as a new CeilingFan. Use the array of fan speeds as the argument for the constructor. 3. Call this new object's powerSwitch() method. This simulates turning on the fan. 4. Call the object's setSpeed() method with the argument 2. This simulates setting the speed to the 3rd setting, which would be 25.7 . 5. Call the object's lightSwitch() method. This simulates turning on the light of the CeilingFan.