Design a class named fan to represent a fan

Assignment Help JAVA Programming
Reference no: EM131587323

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 (the
default is SLOW).
A private boolean data field named onOff 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 that specifies the color of the fan (the default
is blue).
A no-arg constructor that creates a default fan.
A method named ToString() that outputs a description for the fan. If the fan is on, the method prints the fan speed, color, and radius . If the fan is not on, the method prints the fan color and radius along with the string "fan is off" .
Draw the UML diagram for the class and then implement the class. Write a test program that creates two Fan objects. For the first fan, assign fast speed, radius 10, color yellow, and turn it on. For the second fan, assign medium speed, radius 5, color blue, and turn it off. Invoke the toString methods of each object. Create screenshots of the outputs of the toStringmethods.
Note: Ways to draw UMLs -> Draw.io (Recommended)
Other applications ->UMLet; UML Designer; Applications in Eclipse Marketplace
Homework Submissions & Assessment
Your submission should include:
The java source code file
The UML diagrams
Pseudo code showing the design of the class logic
The screen captures/console output of the toString outputs.

Reference no: EM131587323

Questions Cloud

Discuss affine toric variety : (Veronese variety) Let d be a positive integer and let A be the set of k-partitions of d consisting of all a ? Nk such that |a| = d.
How many life vests must lakeview corporation produce : At the beginning of the year, Lakeview Corporation has 640 life vests in inventory. How many life vests must Lakeview Corporation produce during the year
Describe the speed and endurance of the players : Describe the speed and endurance of the players. Describe the strengths and weaknesses of groundstrokes, serve, return, volley, and overhead.
Despite its promoting technology : Neptune Biometrics, despite its promoting technology, is having difficulty generating profits.
Design a class named fan to represent a fan : Design a class named Fan to represent a fan - A private boolean data field named onOff that specifies whether the fan
How does spoofing threaten an e-commerce : 1. How does spoofing threaten an e-commerce site's operations?
How mobile technology is changing the practice of business : Discuss how mobile technology is changing the practice of business communication. Explain how the widespread use of social media has increased the attention.
What is the after-tax cost of debt : Tiny Tots has debt outstanding, currently selling for $860 per bond. What is the after-tax cost of debt?
What is the total manufacturing cost assigned to job : A company assigns overhead cost to completed jobs on the basis of 111% of direct labor cost. What is the total manufacturing cost assigned to job 313

Reviews

Write a Review

JAVA Programming Questions & Answers

  Make an explicit statement of the invariant of the set class

Write a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, You will need to change the interface a bit. For example, instead of the bag's count function, you'll want a constant..

  Write the constructor date which has 3 parameters

The Date.java class. Implement a public class Date that represents a date composed of a month , day, and a year. Declare month, day, and year as integers. Date has a constructor with 3 parameters and 4 methods. Write the constructor Date which has..

  Write a class that has the subsequent fields

Write a class that has the subsequent fields: first name, last name, id number, department, payRate, hoursWork with constructors that accepts the subsequent values as arguments and assigns them to the appropriate fields.

  Write down an applet which displays a 4x4 grid when the

write an applet that displays a 4x4 grid. when the user clicks on a square in the grid the applet should draw a filled

  Program that uses the divide-and-conquer technique

Write a program that uses the divide-and-conquer technique to count the number of inversion in the array and Write a program that uses a transform-and-conqueralgorithm with efficiency class Θ(nlogn) to solve this problem.

  Write a short paper on what your program does

Using your example, write a short paper on what your program does. Include the logical expression and what type of while loop (EOF, sentinel-controlled, counter-controlled, flag-controlled) you need

  Write an application class that contains several methods

Write a driver class. This class should use the main method to call four methods in the application class that will display our JOptionPanes - Write an application class that contains several methods.

  Display a welcome message in a message dialog box

Display a welcome message in a Message Dialog Box (JOptionPane.showMessageDialog()) that includes the full name, e.g., "Welcome John Q Smith.".

  Determine the charge for each customer

The program should display the charge for the current customer and should calculate and display the running total of yesterday's receipts. The program should use the method calculate-Charges to determine the charge for each customer.

  Role of inheritance in object-oriented programming

role of inheritance in object-oriented programming

  Analyze a problem in an object-oriented manner

CSE1/CSE4IOO - analyze a problem in an object-oriented manner, and then design and implement an object-oriented solution that conforms to given specifications

  A game of tic-tac-toe

A game of tic-tac-toe, two players (one the computer) take turns marking an available cell in a 3 X 3 grid (a two dimensional array) with their respective tokens (either and X or an O). When one player has placed three tokens in a horizontal

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd