1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
antiseptic1488 [7]
3 years ago
11

Design and implement your own simple class to represent any household item of your choice (toaster, fan, hair dryer, piano ...)

Your class should have a constructor, one additional method and at least one member variable (e.g. boolean isOn to turn the item on or off). Be sure you demonstrate your class works properly by constructing an instance of it and calling your method. Hint: check out the week 6 module readings under "additional readings". The guitar example is a good model for thisDesign and implement your own simple class to represent any household item of your choice (toaster, fan, hair dryer, piano ...) Your class should have a constructor, one additional method and at least one member variable (e.g. boolean isOn to turn the item on or off). Be sure you demonstrate your class works properly by constructing an instance of it and calling your method. Hint: check out the week 6 module readings under "additional readings". The guitar example is a good model for this..
Computers and Technology
1 answer:
emmasim [6.3K]3 years ago
8 0

Answer:

class fan{

   private String model;

   private boolean isOn;

   //Constructor goes here

   public fan(String model, boolean isOn) {

       this.model = model;

       this.isOn = isOn;

   }

   // An additional method goes here

   public boolean turnOn(boolean yes){

       if(yes) {

           this.isOn=true;

           System.out.println("Fan is blowing");

           return true;

       }

       else

           this.isOn=false;

           System.out.println("Fan is off");

           return false;

   }

}

Explanation:

Demonstrating the working of the class in a main method. Below is a complete code

public class fanTest {

   public static void main(String[] args) {

fan fan1 = new fan("Binatone", false);

       fan1.turnOn(false);

   }

}

class fan{

   private String model;

   private boolean isOn;

   //Constructor goes here

   public fan(String model, boolean isOn) {

       this.model = model;

       this.isOn = isOn;

   }

   // An additional method goes here

   public boolean turnOn(boolean yes){

       if(yes) {

           this.isOn=true;

           System.out.println("Fan is blowing");

           return true;

       }

       else

           this.isOn=false;

           System.out.println("Fan is off");

           return false;

   }

}

You might be interested in
The game often becomes stuck on landscape mode when tilting the device during gameplay, which cuts off some peripheral text. A w
ch4aika [34]

Answer:

The overview of the given situation is described in the explanation segment below.

Explanation:

  • Bug Severity seems to be the extent of influence that somehow a fault will have on the device, while its primary concern is indeed the command of severity that had already affected that same device.
  • You should consider this error as top importance as another framework hangs. I would say you may be lacking the configuration manager settings in your system.

Therefore the above is the right answer.

3 0
3 years ago
The amount of time taken by each of 10 students in a class to complete an exam is an example of what type of data? a. Cannot be
vekshin1

Answer:d) Quantitative data

Explanation: Quantitative data is the data that is required for the measurement of count and then exhibited in the numeric values.It is expressed through the type of name, number,code, symbol etc. It is used in the questionnaire, surveys, interviews etc.

Other options are incorrect because time series data is data according to the time event and categorical data is based on the categories of event.Thus, the correct option is option(d).

8 0
3 years ago
4. is the disappearance of the individual a bad thing?
makkiz [27]

Answer:

The program completed in a third of the time with six computers versus one computer.

Explanation:

7 0
2 years ago
State one way the projector can be integrated into teaching and learning ​
koban [17]

Answer:

The projector con be used to show videos or pictures on a particular subject or topic to gain more understanding

4 0
3 years ago
Time-management techniques work most effectively when performed in which order?
Sholpan [36]

Answer:

study-time survey, project schedule, prioritize tasks, reward system.

Explanation:

Time management can be defined as a strategic process which typically involves organizing, planning and controlling the time spent on an activity, so as to effectively and efficiently enhance productivity. Thus, when time is properly managed, it avails us the opportunity to work smartly rather than tediously (hardly) and as such making it possible to achieve quite a lot within a short timeframe. Also, a good time management helps us to deal with work-related pressures and tight schedules through the process of properly allocating the right time to the right activity.

Hence, time-management techniques work most effectively when performed in the following sequential order; study-time survey, project schedule, prioritize tasks, and designing (creating) a reward system.

4 0
3 years ago
Other questions:
  • Why do we need the Domain Name System (DNS)? Given the domain name www.flamingflamingos.eu, what is the top level domain in this
    5·1 answer
  • Attacker player X is standing still on a corner kick, as the ball is played, he jumps up with his arms flailing above his should
    8·1 answer
  • Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the absolut
    9·1 answer
  • A router is a device that addresses a packet on a network to the next router along the line. Under which layer of the OSI model
    5·1 answer
  • c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
    5·1 answer
  • Which four of the following hardware components are specifically used to enable networking and are not part of a stand-alone com
    13·2 answers
  • Online banking tools allow you to pay bills from your computer. <br> a. True<br> b. False
    5·2 answers
  • Which of the following are the dimensions of feasibility? Group of answer choices cost, schedule, technical, and organizational
    14·1 answer
  • Which of the following is the correct binary representation of the number 2?
    14·1 answer
  • Which statements accurately describe the Outlook interface? Check all that apply.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!