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
maxonik [38]
3 years 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 this behavior: turnOn and turnOff. Both methods take no arguments and return no value.
Assume there is a reference variable myAC to an object of this class, which has already been created. Using the reference variable, invoke a method to tell the air conditioner object to turn on.
Computers and Technology
1 answer:
AleksandrR [38]3 years ago
5 0

Answer:

Hi!

I will use JAVA to answer the question.

The class AirConditioner could be:

public class AirConditioner {

  bolean state;

  AirConditioner(){ <em>//constructor</em>

     this.state = false;

   }

public void turnOff{ <em>//turn off method</em>

 this.state = false;

   }

public void turnOn{ <em>//turn on method</em>

 this.state = true;

   }

}

Program to solve the problem:

public static void main(){ <em>//main program</em>

  AirConditioner myAC = new AirConditioner();  <em>//instanciate the AirConditioner object</em>

  myAC.turnOn(); <em>//call the method turnOn for myAC instance.</em>

}

You might be interested in
JAVA
butalik [34]

Answer:

import java.util.*;

public class MyClass {

   public static void main(String args[]) {

       Scanner input = new Scanner(System.in);

       System.out.print("Input a word: ");

       String userinput = input.nextLine();

       for(int i =0;i<userinput.length();i+=2) {

           System.out.print(userinput.charAt(i));

       }

   }

}

Explanation:

This line prompts user for input

       System.out.print("Input a word: ");

This declares a string variable named userinput and also gets input from the user

       String userinput = input.nextLine();

The following iterates through every other character of userinput from the first using iteration variable i and i is incremented by 2

       for(int i =0;i<userinput.length();i+=2) {

This prints characters at i-th position

           System.out.print(userinput.charAt(i));

5 0
2 years ago
What doyou mean by process model and project model?
vlabodo [156]

Answer:

A process model is a narrative of each type of process. These models consist of processes that are inherently similar and are categorized accordingly; a logical set of actions executed in a comprehensible framework.

A project model is concise and visual, it depicts how a project will be implemented. They are specifically tailored according to each project, describing each of its functional aspects. Decision gates and partitions are important aspects and need to be exemplified throughout the project.

4 0
3 years ago
Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Everyti
Gemiola [76]

Answer:

b. cart total + 1

Explanation:

A. cart total=1 do increment the total with every 1 click here, it only 're-assigns cart total with value 1 for every click, hence it's always 1.

B. In every click, 1 is always added to the previous value of cart total, like addItemButton(cart total+1) or so.

C. This would have worked too if "cart total" and "cartTotal" where of same type.

D. cart total is just being initially defined here.

E. Likewise here, var shows that cart total has just only been declared.

6 0
3 years ago
Consider a collection C of subsets of a nite set V . (V; C) is called a hypergraph. A hypergraph (V; C) is 3-regular if every su
kodGreya [7K]

Explanation:

polynomial-time 3-approximation for the maximum matching problem in 3-regular hypergraphs as follows: Given a 3-regular hypergraph, find a matching with maximum cardinality.

6 0
3 years ago
For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are
Sauron [17]

Answer:

lw $t0, 16($s7) // $t0 = B[4]

lw $t1, 12($s7) // $t1 = B[3]

sub $t0, $t0, $t1 // $t0 = B[4] – B[3]

sll $t0, $t0, 2 // $t0 = $t0 * 4

add $t0, $t0, $s6 // $t0 = &A[B[4] – B[3]]

lw $t1, 0($t0) // $t1 = A[B[4] – B[3]]

add $s0, $s1, $t1 // f = g + A[B[4] – B[3]

Explanation:

lw $t0, 16($s7) // $t0 = B[4]

lw $t1, 12($s7) // $t1 = B[3]

sub $t0, $t0, $t1 // $t0 = B[4] – B[3]

sll $t0, $t0, 2 // $t0 = $t0 * 4

add $t0, $t0, $s6 // $t0 = &A[B[4] – B[3]]

lw $t1, 0($t0) // $t1 = A[B[4] – B[3]]

add $s0, $s1, $t1 // f = g + A[B[4] – B[3]

6 0
3 years ago
Read 2 more answers
Other questions:
  • A weak fuel to air mixture along with normal airflow through a turbine engine may result in?
    8·1 answer
  • Insert a row above the selected row
    11·2 answers
  • If you are viewing a webpage with customized or regenerated content, such as updated stock quotes, what type of webpage are you
    14·1 answer
  • What is a gutter margin?
    5·2 answers
  • Using either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process. Th
    8·1 answer
  • PLEASE HELP ASAP!!!
    8·1 answer
  • Referat noaptea la școala cu sfârșit de groază​
    10·1 answer
  • What is the best way of farming exotics in destiny?
    12·2 answers
  • Demons I shall be your eternal nightmare
    13·1 answer
  • A server is handling thousands of simultaneous connections, and proxying requests to another service. Which concurrency model is
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!