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
Which option will enable Mina to apply several formats to the spreadsheet cells at the same time?
madam [21]
Applying a cell style will enable Mina to apply several formats to the spreadsheet cells at the same time.  <span>To apply several formats in one step, and to make sure that cells have consistent formatting, you can use a cell style. A cell style is a defined set of formatting characteristics, such as fonts and font sizes, number formats, cell borders, and cell shading. </span>
4 0
3 years ago
One reason to buy a home instead of rent a home is:
vazorg [7]
A is the correct Answer

7 0
3 years ago
Explain how Steve Jobs created and introduced the iPhone and iPad.
Natali5045456 [20]

Answer:Today, we're introducing three revolutionary products. The first one is a widescreen iPod with touch controls. The second is a revolutionary mobile phone. And the third is a breakthrough Internet communications device. So, three things: a widescreen iPod with touch controls, a revolutionary mobile phone, and a breakthrough Internet communications device. An iPod, a phone, and an Internet communicator. An iPod, a phone...are you getting it? These are not three separate devices. This is one device. And we are calling it iPhone. Today, Apple is going to reinvent the phone.

Late last year, former Apple engineer Andy Grignon, who was in charge of the radios on the original iPhone, gave behind-the-scenes look at how Apple patched together demos for the introduction, with Steve Jobs showing off developmental devices full of buggy software and hardware issues. The iPhone team knew that everything had to go just right for the live iPhone demos to succeed, and they did, turning the smartphone industry on its head even as Apple continue to scramble to finish work on the iPhone.

Apple had actually been interested first in developing a tablet known as "Safari Pad", but as noted by a number of sources including Steve Jobs himself, the company shifted gears once it became clear how revolutionary the multi-touch interface developed for the tablet could be for a smartphone. Apple's tablet wouldn't surface until the launch of the iPad in 2010, three years after the introduction of the iPhone.

Seven years after the famous Macworld 2007 keynote, the iPhone has seen significant enhancements in every area, but the original iPhone remains recognizable as Apple has maintained the overall look of a sleek design with a larger touchscreen and a single round home button on the face of the device.

Explanation:

8 0
3 years ago
Which of the following defines guidelines that specify the way computers access the medium to which they are attached, the type(
mart [117]

Answer:

network standard

Explanation:

4 0
3 years ago
Trucking A. is one of the least flexible transportation modes. B. is increasingly using computers to manage its operations. C. i
saw5 [17]

Answer:

B. is increasingly using computers to manage its operations.

Explanation:

Trucking -

It refers to the practice of using computer for the management purpose , is referred to as the process of trucking .

The method is very useful for the business and companies in order to adapt a faster and efficient mode of management .

Hence , from the given information of the question ,

The correct option is b. is increasingly using computers to manage its operations.

7 0
3 years ago
Other questions:
  • "the ____ criteria filter requires the records displayed to have the specified text string anywhere."
    11·1 answer
  • Wireless attacks avoid the access points to limit detection. <br> a. True <br> b. False
    9·1 answer
  • One form of online vandalism is ____ operations, which interfere with or disrupt systems to protest the operations, policies, or
    9·2 answers
  • In addition to ranking the relevance of a particular site according to the keywords entered by the user, which of the following
    10·1 answer
  • What framework provides a simple API for performing web tasks?
    13·1 answer
  • Ben is writing a paper for his college history class, and he wants to include some information he found on a Web site. What are
    5·1 answer
  • Write a function called no_you_pick. no_you_pick should have two parameters. The first parameter is a dictionary where the keys
    5·1 answer
  • What is the best approach to testing a website? visit all pages to verify that they load visit every page and verify all links v
    7·1 answer
  • Hyperlink is a term used to refer to the specific manner of specifying the address of a website. Write reason for true or false.
    10·1 answer
  • Which way do you swipe in ios to get to the control center
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!