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

  Given the dimensions of a crate

Given the dimensions of a crate (side 1, side 2, and side 3), find the largest surface area it can provide when used as a table. A test case provided is if side 1, side 2, and side 3 are 1, 2, and 3, respectively, the largest surface area is 6. Ca..

  Describe retail events in terms of pci compliance standard

You visit retail establishment, shop around, and ultimately carry several products to one of the point of sale. Document each main events just explained and describe them in terms of PCI compliance standard.

  What will occur to supply-demand in short-term and long-term

Price of product in short-term and long-term also describe why you think supply, demand, or equilibrium price will be different, if at all, in short-term and long-term.

  Prove by solving the equations using laplace transform

For a RC circuit, we can use Laplace transforms to show that when we apply a step input of 5V, the voltage across the capacitor rises exponentially to a final value equal to step input.

  How linear program the problem of finding the maximum profit

Formulate as a linear program the problem of finding the maximum profit weekly production mix. Solve the linear program from Part A using the Simplex method.

  Tools or techniques to use as a project manager

Identify at least three ideas, tools, or techniques that you have learned from this course and plan to use as a project manager. What will be most helpful to you?

  Alternative donation scenario

Another alternative donation scenario is to deposit $25,000 now in a savings account with a guaranteed rate of return of 5% per year compounded monthly.

  Write program to enter two separate numbers

Write a program which would permit a user to enter two separate numbers and choose one of four mathematical operations (add, subtract, multiply, divide).

  Can a computer system function without one of these element

- What purposes do CPUs, memory and I-O devices individually serve in a computer system? - How do these 3 elements work together to compute? - Can a computer system function without one of these elements?

  Write the function xsort which takes in a list of strings

Write the function Xsort wich takes in a list of strings and returns sorted list with all words beginning wih "X" first in the list. f.ex: xsort (['kex', 'xylofonn', 'epli', 'xenos', 'asni']) returns ['xenos', 'xylofonn', 'asni', 'epli', 'kex'] th..

  Convert hexadecimal number into unpacked bcd number

Convert any hexadecimal number from 00 to 63h placed in AX into its equivalent unpacked BCD number in AX. Multiply byte in register AL by byte in register BL. Place result in AX.

  Design a digital filter with the following specifications

Design a digital filter with the following specifications: Cutoff frequency = 1,000 Hz Sampling rate = 16,000 Low-pass filter What is the digital normalized frequency in radians?

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