answer.
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
MaRussiya [10]
1 year ago
7

Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off. The follow

ing methods provide these behaviors: turnon and turnoff. Both methods accept no arguments and return no value. Assume there is a reference variable officeAC of type AirConditioner. Create a new object of type AirConditioner and save the reference in officeAC. After that, turn the air conditioner on using the reference to the new object. 2. Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and setting the desired temperature. The folowing methods provide these behaviors: turnon and turnoff, which accept no arguments and return no value, and setTemp, which accepts an int argument and returns no value. Assume there is a reference variable officeAC of type AirConditioner. Create a new object of type AirConditioner and save the reference in officeAC. After that, use the reference to turn on the new air conditioner object and set the desired termperature to 69 degrees
Computers and Technology
1 answer:
Dafna11 [192]1 year ago
6 0

Answer:

1)

officeAC = new AirConditioner();

officeAC.turnOn();

2)

officeAC = new AirConditioner();

officeAC.turnOn();

officeAC.setTemp(69);  

Explanation:

1)

In the first statement a new object of the class AirConditioner whose reference is assigned to the officeAC. new is a keyword which creates an object of the class.

Next statement uses the method turnOn(). Reference to the new object officeAC is used to invoke this method turnOn().

2) The first two statements works the same as in 1)

The last statement invokes a method setTemp() using the reference variable and passes the value 69 to this method to set the desired temperature.

You might be interested in
Write a function that implements another stack function, peek. Peek returns the value of the first element on the stack without
devlian [24]

Answer:

See explaination

Explanation:

StackExample.java

public class StackExample<T> {

private final static int DEFAULT_CAPACITY = 100;

private int top;

private T[] stack = (T[])(new Object[DEFAULT_CAPACITY]);

/**

* Returns a reference to the element at the top of this stack.

* The element is not removed from the stack.

* atreturn element on top of stack

* atthrows EmptyCollectionException if stack is empty

*/

public T peek() throws EmptyCollectionException

{

if (isEmpty())

throw new EmptyCollectionException("stack");

return stack[top-1];

}

/**

* Returns true if this stack is empty and false otherwise.

* atreturn true if this stack is empty

*/

public boolean isEmpty()

{

return top < 0;

}

}

//please replace "at" with the at symbol

Note:

peek() method will always pick the first element from stack. While calling peek() method when stack is empty then it will throw stack underflow error. Since peek() method will always look for first element ffrom stack there is no chance for overflow of stack. So overflow error checking is not required. In above program we handled underflow error in peek() method by checking whether stack is an empty or not.

3 0
2 years ago
Access to sensitive or restricted information is controlled describes which of the key communications and information systems pr
Viktor [21]

Answer:

C: Security

Explanation:

Communications and information systems principles need to be, among other things, secure. They need to be able to protect sensitive information from those who intentionally not need to know. Some incident information like voice, networks, and data, are very sensitive and thus, should be secure to the right levels and should comply with privacy laws and data protection.

4 0
2 years ago
5.William travels a lot on business purpose. He needs to regularly communicate with his business partner. He also needs to send
FromTheMoon [43]

Microsoft Online is free to use. It includes Microsoft Excel, Word, One - Note and PowerPoint.  Microsoft Outlook (email app) is free as well, although it is a seperate download.

Another way to go is via Google docs, The Google drive is rather large and safe to store reports, docs, images, etc.

Both Microsoft online and Google Docs are accessible to use on virtually any device as in: PCs, Laptops, Tablets, Androids and Iphones.


4 0
1 year ago
More Loops: All versions of foods.py in this section have avoided using for loops when printing to save space. Choose a version
Nata [24]

Answer:

Following are the program in the Python Programming Language.

#set list type variable and initialize the elements

myPizza = ['Margarita', 'Capsicum and onion', 'Chicken']

#set variable and initialize the elements

frndPizzas = myPizza[:]

#append value in list variable

myPizza.append('Corn')

#append value in list variable

frndPizzas.append('paperica')

#print message

print("My pizzas are:")

#set the for loop and print elements of 1st list

for pizza in myPizza:

   print(pizza)

#print message

print("\nFriend's pizzas are:")

#set the for loop and print elements of 2st list

for frndsPizza in frndPizzas:

   print(frndsPizza)

<u>Output</u>:

My pizzas are:                                                                                                                  

Margarita                                                                                                                       Capsicum and onion                                                                                                               Chicken                                                                                                                          Corn                                                                                                                                                                                                                                                        

Friend's pizzas are:                                                                                                            

Margarita                                                                                                                      Capsicum and onion                                                                                                              Chicken                                                                                                                         paperica    

Explanation:

<u>Following are the description of the program</u>:

  • Set a list data type variable that is 'myPizza' and initializes elements in it.
  • Set another list data type variable that is 'frndPizzas' and initializes elements in it.
  • Append one-one element in both of the list data type variables.
  • Set the for loops to print the elements of both list data type variables.
5 0
1 year ago
1. What might you say to someone whose reason for investing in 90% bonds and 10% stocks is that they want a 6% return on investm
Gemiola [76]

Investing in 90% bonds and 10% stocks will provide an average return of 6% on investment.It is advisable to invest more portion in bonds  is safe and will give higher return for investment than stocks

Explanation:

1. According to the graph investing in 90% bonds and 10% stocks will provide an average return of 6% on investment.

2.Investing in bonds is safe than stocks ., because bonds bear fixed rate of interest ., and investing in the bonds having very less risk than the stocks. By comparing stocks and bonds with the help of graph ., it's very clear bonds has a positive growth starting minimum at 32.6% to maximum at 64.2% as returns .But stocks has a negative growth (value) from -8.2% to maximum -43.1% .,It is advisable to invest more portions in bonds is safe and better than invest in stocks.

5 0
2 years ago
Other questions:
  • Computer design software requires __________________ to be used properly and successfully by architects.
    9·2 answers
  • ________ is used to undo unwanted database changes.
    15·2 answers
  • The term drive app is used to describe applications stored on a computer true or false
    11·2 answers
  • Technician A says that the octane rating of gasoline is the measure of its antiknock properties. Technician B says that normal c
    5·1 answer
  • Propane also known as LP gas, is often mixed with about _______ percent of other gases, such as butane, propylene, and mercaptan
    13·1 answer
  • Which of the following blocks is least similar to the others?
    8·2 answers
  • In its simplest form, communication is defined as ________.
    7·1 answer
  • With Voice over Internet Protocol (VoIP), _____. a. voicemails cannot be received on the computer b. call quality is significant
    6·1 answer
  • Mara's presentation included essential information about the company's new safety procedures. She wanted to make
    13·2 answers
  • Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method. public cla
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!