Question
please write down the methods, pretend get and set functions are already made and so on. variables are String color, String speed( none, slow, medium
please write down the methods, pretend get and set functions are already made and so on.
variables are String color, String speed( none, slow, medium or fast), boolean on, double radius.
A method called turnON which will turn the fan on if it is not already on. It has no parameters and sets the speed of the fan to SLOW. if the fan is already turned on, dont change the speed to slow.
A method called faster. This changes the speed of the fan and has no parameters. If the fan is already at FAST it does not change; otherwise it speeds the fan up one speed (e.g., from SLOW to MEDIUM).
A method called slower. This changes the speed of the fan (has no parameters). If the fan is already at SLOW it does not change; otherwise it slows down the fan by one speed (e.g., from FAST to MEDIUM)
A method called turnOff that turns the fan off if it is on (has no parameters). It sets the speed of the fan to NONE.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started