Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: You should submit your answer to this question as a Python code with .py extension to the corresponding question in Google Classroom. Attention: Make

image text in transcribed

Instructions: You should submit your answer to this question as a Python code with .py extension to the corresponding question in Google Classroom. Attention: Make sure to write your name, surname, department, and student ID number. Question: (The Fan class) Design a class named Fan to represent a fan. The class contains: 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 that specifies the speed of the fan. 1 A private bool data field named on that specifies whether the fan is on (the default is False). 1 A private float data field named radius that specifies the radius of the fan. A private string data field named color that specifies the color of the fan. The accessor and mutator methods for all four data fields. A constructor that creates a fan with the specified speed (default SLOW), radius (default 5), color (default blue), and on (default False). Draw the UML diagram for the class and then implement the class. Write a test program that creates two Fan objects. For the first object, assign the maximum speed, radius 10, color yellow, and turn it on. Assign medium speed, radius 5, color blue, and turn it off for the second object. Display each object's speed, radius, color, and on properties

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

5. What information would the team members need?

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago