The Fan class) Design a class named Fan to represent a fan. The class contains: The Fan class Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to denote the fan speed. A private int data field named speed specifies the speed of the fan (the default is SLOW). A private boolean data field named on that specifies whether the fan is on (the default is false). A private double data field named radius that specifies the radius of the fan (the default is 5). A string data field named color specifies the color of the fan (the default is blue). Accessor and mutator methods for all four data fields. A no-arg constructor that creates a default Fan. A method named toString() that returns a string description for the fan.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 12SA
icon
Related questions
Question
100%

9.8 (The Fan class) Design a class named Fan to represent a fan.

The class contains:

  1. The Fan class Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to denote the fan speed.
  2. A private int data field named speed specifies the speed of the fan (the default is SLOW).
  3. A private boolean data field named on that specifies whether the fan is on (the default is false).
  4. A private double data field named radius that specifies the radius of the fan (the default is 5).
  5. A string data field named color specifies the color of the fan (the default is blue).
  6. Accessor and mutator methods for all four data fields.
  7. A no-arg constructor that creates a default Fan.
  8. A method named toString() that returns a string description for the fan.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning