Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in Java, and include the TEST too Question 2: Fan.java and va Design a class named Fan (Fan java) to represent a fan. The

Write in Java, and include the TEST too image text in transcribed
Question 2: Fan.java and va Design a class named Fan (Fan java) to represent a fan. The class contains: An int field named speed that specifies the speed of the fan. A boolean field named fanStatus that specifies whether the fan is on (default false). A double field named radius that specifies the radius of the fan (default 5). A string field named color that specifies the color of the fan (default blue). A no-arg (default) constructor that creates a default fan. A constructor that creates a fan with four parameters: speed, fanStatus, radius, and color. A method named toString0 that returns a string description for the fan. The method returns the fan speed, color, radius, and fan status (either on or off) in one combined string. Write a TestFan program that asks the user to enter the fan speed, radius, fan status, and color. The program creates a fan object by using the constructor with four parameters. Then it should display the fan description by invoking their toString() method

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

How is the Travelling Salesman Problem modeled as a graph problem?

Answered: 1 week ago

Question

=+ What are the information and consultation requirements?

Answered: 1 week ago

Question

=+ Should the MNE belong (why, why not)?

Answered: 1 week ago