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
solong [7]
3 years ago
8

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

following methods are provided for these behaviors: turn_on and turn_off. Both methods accept no arguments and return no value. There is a reference variable office_a_c of type AirConditioner. Create a new object of type AirConditioner using the office_a_c reference variable. After that, turn the air conditioner on using the reference to the new object.
Computers and Technology
1 answer:
Sunny_sXe [5.5K]3 years ago
8 0

Answer:

The code is given in the explanation section

Explanation:

//Class Airconditioner

public class AirConditioner {

   private boolean turnOnOff;

//The Constructor

   public AirConditioner(boolean turnOnOff) {

       this.turnOnOff = turnOnOff;

   }

//method turn_on

   public void turn_on(){

       this.turnOnOff = true;

   }

//method turn_off

   public void turn_off( ){

       this.turnOnOff = false;

   }

}

// A new class to test the airconditional class

class AircondionTest{

   public static void main(String[] args) {

//Creating an object of the Aircondional class

       AirConditioner office_a_c = new AirConditioner(false);

//Using the reference varible to call method turn_on      

office_a_c.turn_on();

   }

}

You might be interested in
When doing a Risk assessment, what is one of the most important things to do?
GaryK [48]

Answer:

Determine who might be harmed and how.

8 0
2 years ago
Read 2 more answers
What kind of script is used to run code on the client
s2008m [1.1K]

Answer: JavaScript. What kind of script is used to run code on the client

4 0
2 years ago
A(n) _______ attack attempts to make a server or network unavailable to serve legitimate users by flooding it with attack packet
malfutka [58]

Answer:

DoS or Denial of Service

Explanation:

Have a nice day! :)

3 0
2 years ago
Write a c++ program to print even numbers from 1 to 20​
Novay_Z [31]

Answer:

#include <bits/stdc++.h>

using namespace std;

// Function to print even numbers

void printEvenNumbers(int N)

{

cout << "Even: ";

for (int i = 1; i <= 2 * N; i++) {

// Numbers that are divisible by 2

if (i % 2 == 0)

cout << i << " ";

}

}

// Function to print odd numbers

void printOddNumbers(int N)

{

cout << "\nOdd: ";

for (int i = 1; i <= 2 * N; i++) {

// Numbers that are not divisible by 2

if (i % 2 != 0)

cout << i << " ";

}

}

// Driver code

int main()

{

int N = 20;

printEvenNumbers(N);

printOddNumbers(N);

return 0;

}

Explanation:

Note: This will find both odd and even numbers, you have to change the number above to the number of your choice

For even numbers

Even number are numbers that are divisible by 2.

To print even numbers from 1 to N, traverse each number from 1.

Check if these numbers are divisible by 2.

If true, print that number.

For odd numbers

Odd number are numbers that are not divisible by 2.

To print Odd numbers from 1 to N, traverse each number from 1.

Check if these numbers are not divisible by 2.

If true, print that number

8 0
3 years ago
Using powerpoint 2016, ethan develops a short five-slide presentation for his marketing project. â â powerpoint files consist of
Lady bird [3.3K]
b. Ribbons  - Powerpoint 2016 has a tabbed ribbon system that groups relevant menus together according to category. The ribbon contains a number of tabs, each having a separate group of commands. The tabs can be used to do most of the common tasks in Powerpoint.
8 0
3 years ago
Other questions:
  • Which best describes inserting a table using the Table Gallery
    10·2 answers
  • While performing an automatic transmission service at 60,000 miles, the technician notices a grayish sludge on the magnet in the
    15·1 answer
  • I need help!
    14·1 answer
  • What system calls have to be executed by a command interpreter? Why is it usually separate from the kernel?
    12·1 answer
  • Which one is not the part of motherboard ?<br>O Registers<br>O<br>Bus<br>O<br>Port<br>O<br>none​
    14·1 answer
  • The process of identifying and removing logical errors and runtime errors is called ..............
    5·2 answers
  • What tells the hardware what to do and how to do it?
    9·1 answer
  • Kai notices his laptop is running sluggishly, so he wants to check his system resources for any issues. Which utility can he use
    11·2 answers
  • 1. Define the term M.A.N.
    5·2 answers
  • Synthesize (15 points)
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!