Design a class named fan to represent a fan

Assignment Help Basic Computer Science
Reference no:

Design a class named Fan to represent a fan. The class contains: * Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote 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 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 that specifies the color of the fan (default is blue.) * The 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. 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 the radius along with the sting "fan is off" in one combined string.

Reference no:

Questions Cloud

Calculate the herfindahl- hirschman index value and the cr4 : The market shares below are hypothetical and should not be cited in any paper you write in a future business class. General Motors = 24% Toyota = 20% Ford = 16% Honda = 12% Chrysler = 10% BMW = 7%
Explain the density of the balance weights : A sample of solid having a density of 3.43 g/cm3 had an apparent mass of 13.9264. The density of the balance weights is 8.00 g/cm3. Calculate the true mass of the object.
Evaluate the changes in technology and mass communication : Evaluate the changes in technology and mass communication with the effects these have on the justice and security areas.Evaluate the issues involved with individual rights versus the needs of the justice system and security to maintain order and p..
How to justify government subsidies of home ownership : Proponents of these subsidies lobby government and argue that these subsidies are justified because there are positive externalities from people owning homes instead of renting. Perform a Google search to find what externalities these proponents c..
Design a class named fan to represent a fan : Design a class named Fan to represent a fan. The class contains: * Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote fan speed.
Determine the methods of forecasting : Determine the methods of forecasting, process or service design, layout planning, and capacity planning
Explain the molar concentration of cl : The flask is then rinsed with 64.6 mL of distilled water and is then used to prepare a standard solution of KNO3. Compute the molar concentration of Cl- in the standard KNO3 solution if the flask is rinsed only one time with distilled water.
What were two main competing arguments made : What were the two main competing arguments (i.e., one pro, one con) made with regards to whether or not AT&T and T-Mobile should have been allowed to merge Do you think the two should have been allowed to merge
Write a recursive : Write a recursive, int -valued function named productOfOdds that accepts an integer array, and the number of elements in the array and returns the product of the odd-valued elements of the array. You may assume the array has at least one odd-value..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Compute the transmission line utiliza

Consider that packets arrive at an internet router from 3 different other routers, each with Poisson arrivals with l = 4 per second. The packets are all transmitted on the same transmission line

  Discuss whether design considerations need to change

Are there certain projects in which the traditional approach would work better? If not, explain why not. If so, give at least one example of such a project.

  Writing return statement in a value returning function

What would be wrong with not writing returnstatement in a value returing function? Can you have a returnstatement in a void function? Does the return statement in the following function cause syntax error?

  How cost of box is evaluated in lookup table

Cost of box is determined by looking up value in a lookup table. Shipping cost also is determined by looking up value in a lookup table. Use table at cells H23:J28 with a VLOOKUP function to determine cost of a box.

  Find the vector clocks of all the events

Suppose Process P1 has events e11, e12, e13, e14, e15 e16 e17 P2 has events e21, e22, e23, e24, e25, e26, P3 has events e31, e32, e33, e34, e35 e36 There are message transits from e12 to e22, e24 to e15, e21 to e32, e35 to e25.

  Consider an rgb raster system and color lookup table

Consider an RGB raster system that has a 1024 by 800 frame buffer with 16 bits per pixel and a color lookup table with 24 bits per pixel.

  What is the propagation delay on a circuit using a leo

What is the propagation delay on a circuit using a LEO satellite orbiting 500 miles above the earth if the speed of the signal is 186,000 miles per second? If the satellite is 22,000 miles above the earth?

  What is the standard deviation for the true error rate

Consider a learned hypothesis, h, for some boolean concept. What is the standard deviation and the 95% confidence interval for the true error rate for Errorv(h)?

  Hash function h is used and the signature

Suppose a hash function h is used and the signature must be valid for h(m) instead of m. Explain how  this scheme protects against existential forgery

  Atmega128 is being used to monitor humidity inside test cham

Atmega128 is being used to monitor humidity inside test chamber 03. The device uses two sensors to have some fault tolerance. They are connected to ADC channels 0 and 1. The program uses the average and maximum error of the two values.

  Explaining real-world group support system success stories

Identify one real-world Group Support System success stories (e.g., from vendor Web sites or from reports/articles) and describe them.

  Determine the date in opening of letter

If /home/jenny/draft and /home/alex/letter are links to same file and following sequence of events occurs, what will be date in opening of letter? Alex gives command vim letter.

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