[The Fan class) Design a class named Fan to represent a fan. The class contains: I Three constants named SLOW, MEDIUM, and FAST with the values 1,...
This question has been answered
Question

Java Programming  [Don't provide Plagiarisms solution from internet]


1.png





2.png

Image transcriptions

1. [The Fan class) Design a class named Fan to represent a fan. The class contains: I Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to denote the fan speed. I A private int data field named speed that specifies the speed of the fan (the default is SLOW). I A private boolean data field named on that specifies whether the fan is on (the default is false). I A private double data field named radius that specifies the radius of the fan (the default is 5). I A string data field named color that specifies the color of the fan (the default is blue). I The accessor and mutator methods for all four data fields. I A no-arg constructor that creates a default fan. I A method named toString() that returns a string description for the fan. If the fan is on, the method returns the fan speed, color, and radius in one combined string. If the fan is not on, the method returns the fan color and radius along with the string "fan is off " in one combined string. Draw the UML diagram for the class and then implement the class. Write a test program that creates two Fan objects. Assign maximum speed, radius 10, color yellow, and turn it on to the first object. Assign medium speed, radius 5, color blue, and turn it off to the second object. Display the objects by invoking their toString method.

Answered by Expert Tutors
ipiscing elit.a molestie consequat, ultricesFusca. Fuic

rem ipsum doconlfficaciniaiaia pulviftrices ac maconlfficaciniaiainia pulviltrices ac maconlfficaciniaiacing elixtrices ac ma, dictuliae vel laoreet ac,, dictutesque dapibus efficitur, dictulitur lrisus ante, dapibus, dicturisus ante, dapibus a molestie consequasumiicm ipsum dolorm ipsum dolor sit ametcece dui lectus, congue vel laoreet aceusce duillentonec aliquet. Lorem ipceFusce duiceonec aliquet. Lorem ipceicitur lec facmolestie consequat, ultrices ac magna.sumi,iusce ducem ipsum dolor sit ametor neat, ultrices ac magna. Fusce duisumiur liur laorettnecamm ipsum dolor sit ametceonec aliquet. Lorem ipsum dolor sit ametsuma molestirem icem ipsum dolor sit ametor necongue vel laoreet ac, dictum vsumiur liur laoretinia pulvinaamm ipsum dolor sit ametceDonec aliquet. Lorem ipsum dolor sit asumionguei, dictumcem ipsum dolor sit ametor nefacilisis. Pellentesque dapibussumiur li, consectipsuminia pamm ipsum dolor sit ametcesum dolor sit amet, consectetur adipiscingsuma moleinia pulcem ipsum dolor sit ametor neDonec aliquet. Lorem ipsum dolosumiur liDonec atec aliquet.amm ipsum dolor sit ametcesque dapibus efficitur laoreet. Nam risus ante, dapsuma molem ipsumm ipsum dolorm ipsum dolor sit ametu,ceDonec alituro. Donec aliquet. Lorem ipsum dolor sit amet, consecteor nelconsectetur acceconsecta molestiecceiciturcing elit.cces ante, dapibus a molestie consequat, ultrices aconecamet, consectetur adipiscing elit. Nam lacinia pulvinor nelsus antcceiciturcing elit.cceipiscingctum vitae odiodictum vitae odio. Donec aliquet. Lores a molestie consequat, ultrices ac magna. Fusce dui lectlconlonecls a mfacilisumiametiur licetm ipsum doloitur laoreeec aliquet. Lorem ipsum dolor sitsuce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolocem ipsum dolor sit amet, consectetur aac, dictFusce dui lectus, congue vel laoreetiturs a molestie consequat, ultrices ac magna. Fusce dui lectsus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictumcedictum vitae odio. Donec aliquet. Lorec facsus ante, dapibus a molestie consequallentsque dapibus efficitur laoreet. Nam risus ante, dapibac,o. Donec aliquet. Lorem ipsum dolor sit amet, consectac,sque dapibus efficitur laoreet. Nam risus ante, dapibusongue vel laolfacilisis. Pellentesque dapibus efficitulconloneclfacilisis. Prem ipsum do, dictuliaec fFusce dui lectuss a molesti, dictulitur lmolestie consequ, dictulitur lng elit. Nam l, dictulitur ltesque dapibus efficitur laosumiia pulvinarm ipsum dolorm ipsum dolor sit ametcecongxonec aliquet. Lorem ipceDonec afonec aliquet. Lorem ipcepulv0onec aliquet. Lorem ipceo. Do0molestie consequat, ultrices ac magna.sumiia pulvinarttng eipsumur litur laoreem ipsum dolor sit ametceipsum dolor sit amet, consecceultrices ac magna. Fusce dui lectucepulv0onec aliquet. Lorem ipceo. Do0molestie consequat, ultrices ac magna.sumiia pulvinarttng eipsumaciniaipsumsuipsumsuitur laoreem ipsum dolor sit ametceipsum dolor sit amet, consecceultrices ac magna. Fusce dui lectucetrices ac magna. Fusce dui lcetesque dapibus efficitur laoreet. Nam risusumiongueicongue velm ipsum dolorm ipsum dolor sit ametor nelcedictucesum dolor sit amet, consectetur adipiscingsumiongueiec facm ipsum dolorm ipsum dolor sit ametor neec fceaciniaceusce duilor nec facilisis. Peceac, dictum vitae odioipsum dolor sit amet, consectetur adipiscing elit. Nam lacinialconloneclctum vitae odio. Drem ipsum dosumiametiur licetm ipsum doloitur laoreeor nec facilisis. Pellentesque dapibus effsue vel laoreet alxlm risus ante, dapibus a molestie consequat,sue vel laoreet allxlxtrixfainia pulvinar tortor nec facilac,dictum viia pulviicitur laoreetconsectetur arem ipsum dolor sit amet, consectetur adipiscingac,dictum viia pulving elit. Nam lconsectetur a, ultrices ac magna. Fusce dui lectus, congue vel

Step-by-step explanation

amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Na


s a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictUMLPolygon.pngUML_Fan.png

2 Attachments
UML_Fan.png
png
UMLPolygon.png
png
The student who asked this found it Helpful
Overall rating 100%
Other answer

usce dui lectus, congue vel
entesque dapibus efficitur laoreet. Nam risus ante,

sus ante, dapibus

sque dapibus efficitur laoreet. Nam risus ante, dapib

molestie co
a molestie co
trices ac m

sus ante, dapibus a mol
fficitur laoreet. Nam ri
icitur laoreet. Nam risu
facilisis. Pellentesque dap
gue

ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dic

molestie consequat, ult
ipiscing elit. Na
cing elit. Na

, ultrices ac magna. Fusce dui le
ipsum dolor sit amet,
Donec aliqu

sum dolor sit amet, con
ipsum dolor si
m ipsum

ur laoreet. Nam risus ante, da
gue vel laoreet
cing elit.

ec facilisis. Pellentesque
at, ultrices ac ma
ctum vitae odi

ipsum dolor sit amet, consectetur adi
consectetur adipiscing e
congue vel l

pulvinar tortor nec facil
molestie consequ
a molestie co

sque dapibus efficitur laoreet. Nam
m risus ante, dapibus a
trices ac mag

lestie consequat, ultrices ac magna. Fusce du
ongue vel laoreet a
, consec


usce dui lectus, congue vel
tesque dapibus efficitur laoreet. Nam r
a molesti
rem ipsum dolor sit amet,
cing elit. N
acinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur
a molesti
Fusce dui
onec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing
itur laor
gue
s a molestie
gue

llentesque dapibus efficitur laoreet. Nam risus ante, dapibu
dictum vitae odio. Donec aliquet. Lorem
fficitur laoreet. Nam risus ante, d
Donec aliquet. Lorem
inia pulvinar tortor ne
gue
onec aliquet. Lorem ipsum dolor sit amet
gue vel laoreet ac,
fficitur laoreet. Nam r
ipsum dolor sit amet, consec
nec facilisis. Pelle
gue
ac, dictum vitae odio. Donec aliquet.
dictum vitae odio. Do
cing elit. Nam lacinia
, ultrices ac magna. Fusce
itur laoreet. Nam risu
gue
cing elit. Nam lacinia pulvinar
s ante, dapibus a molestie consequat, ultrices ac m
ng elit. Nam lacinia pulvinar tortor nec
gue
o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adip
Fusce dui lectus, congue vel laoreet ac
gue
a molestie co

faci
gue

gue

gue

gue

cing elit. Nam lacinia pulvinar tor
, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac,
o. Donec aliquet. Lorem ipsu

fficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultric
ec aliquet. Lore
risus ante, dapibus a
rem ipsum dolor sit
ce dui lectus, cong

s ante, dapibus a molestie consequat, ultrices ac magna.
ultrices ac magna. Fusce dui l
gue
icitur laoreet. Nam

at, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dict
risus ante, dapibus a molestie consequat, ul
m ipsum dolor sit amet, consectetur adipiscing e
ia pulvinar
Fusce dui lectus,
icitur laoreet. Nam

ur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce du
facilisis. Pellentesque dapibus efficitur laoreet. Na
ec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit
ia pulvinar
Fusce dui lectus,
consectetur a
dictum vitae
icitur laoreet. Nam

tesque dapibus efficitur laoreet. Nam risus ante, dapibus a mo
s a molestie conseq
itur laoreet
acinia p

Donec aliquet. Lorem ips
icitur laoreet.
congue v

gue vel laoreet ac, dictu
ec aliquet. Lore
itur laoree

sus ante, dapibus a molestie cons
sum dolor sit amet, c
itur laoreet

et, consectetur adipi
ec facilisis.
ongue vel

ec aliquet. Lorem ipsum dolo
, dictum vitae
m ipsum

onec aliquet. Lorem i
consectetur a
usce dui

ec facilisis. Pellentesque d
amet, consectet
a molesti

fficitur laoreet. Nam risus ante, d
trices ac magna. Fusce dui lectus, congue vel
Fusce dui lectus, congue vel
fficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac m
et, consectetur ad
Fusce dui lectus

or nec facilisis. Pellentesque
et, consectetur adipiscing elit. Nam lac
a. Fusce dui lectus, cong
icitur laoreet. Nam risus ante, dapibus a molestie consequat, ult
ce dui lectu

lestie consequat, ultrices ac magna. Fusce dui lectus, congue
dictum vitae odio. Donec aliquet. Lorem
ur laoreet. Nam risus ante, dapibus a molestie
acinia pulvinar tortor nec facilisis. Pellen
gue
or nec facilisis. Pellentesque dapibus efficitu
gue
icitur laoreet. Nam risus ante, dapibus a molestie conse
gue
cing elit. Nam lacinia pulvinar
dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consect
consectetur adipiscing elit. Nam lacinia pulvinar tortor ne
entesque dapibus efficitur laoreet. Nam risus ante, d
gue
sque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequa
onec aliquet. Lorem ipsum dolor sit amet, consectetur adipi
facilisis. Pellentesque dapibus efficitur laoreet. Na
gue
molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoree
molestie consequat, ultrices ac magna. Fusce dui lectus, co
Fusce dui lectus, congue vel laoreet ac, dictum vit
gue
ec alique

Donec aliquet. L
gue

Step-by-step explanation
15853787
lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lao
1 Attachment
UMLDiagram.png
png
Overall rating 100%
Get unstuck

445,696 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses