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
yanalaym [24]
2 years ago
10

What is wrong with this case statement -> case (x > 2):

Computers and Technology
1 answer:
ElenaW [278]2 years ago
3 0

Answer:

A: cases can't have a test condition

Explanation:

Under the hood, switch statements don't exist. During the mid-stage of compilation, a part of the compiler will lower the code into something that is easier to bind. This means that switch statements become a bunch of if statements.

A case in a switch statement acts upon the switch value. Think of the case keyword as the value you pass into the switch header:

int x = 10;

switch (x)

{

case (x > 2):

     // Code

     break;

}

// Becomes

if (x(x > 2))

{

// Code

}

// Instead do:

switch (x)

{

case > 2:

     // Code

     break;

}

// Becomes

if (x > 2)

{

// Code

}

You might be interested in
A measure of the processing power of a computer
IgorLugansk [536]
<h2>Million instructions per second (MIPS)</h2>

Explanation:

Real-life example of measurement:

Like how we measures vegetables & fruits in Kilograms, how we measure water or other liquids in liters, we measure the processing power of a computer with the help of unit called MIPS.

What is processing power?

The number of instruction that a computer can process in one second helps us to calculate the "speed of the computer".

This can also be termed as measuring the clock speed. Its measured in Giga hertz or mega hertz.

Why this is necessary?

  • It is to pick the best system to buy. (Also considering the need an budget)
  • Purchasing system based on the requirement.

6 0
4 years ago
The _______ valve protects the air pump from reverse-exhaust pressure.
alexandr402 [8]
D. The answer for this is the gulp
7 0
3 years ago
Need ASAP
expeople1 [14]
The customer should consider buying the hard drive
3 0
3 years ago
Your essay is due tomorrow and you don't have time to write it. You decide to buy an essay online. You've paid for it, so it can
viva [34]

Answer:

false

even though you have paid for it , you still didn't write it by yourself, there for it will still be seen as plagiarism.......hope this helps

4 0
4 years ago
6.12.1: Return number of pennies in total. Write a function NumberOfPennies() that returns the total number of pennies given a n
Anit [1.1K]

Answer:

public class Pennies

{

public static void main(String[] args) {

 System.out.println("Total pennies: " + NumberOfPennies(5, 6));

               System.out.println("Total pennies: " + NumberOfPennies(5));

}

public static int NumberOfPennies(int amount, int pennies) {

    int total = (amount * 100) + pennies;

   

    return total;

}

public static int NumberOfPennies(int amount) {

    NumberOfPennies(amount, 0);

    int total = amount * 100;

   

    return total;

}

}

Explanation:

- Create a function called NumberOfPennies that takes two parameters, amount and pennies

- In order to calculate the number of pennies, multiply the given amount by 100 and add the pennies. Set this result to the total and return the total.

- Since pennies parameter should be optional, overload the function NumberOfPennies so that it can take one parameter, amount. When it takes one parameter, the value of the pennies set to 0.

Inside the main, call the function with two possible scenarios

3 0
3 years ago
Other questions:
  • Suppose arraylist list1 is [1, 2, 5] and arraylist list2 is [2, 3, 6]. after list1.addall(list2), list1 is __________.
    8·1 answer
  • Charlie wants you to include the following topics in your presntation: an overview of project management and its hrity,a descrip
    15·1 answer
  • Our readings so far explored computer hardware and software, in particular operating systems and application software. There are
    11·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    7·1 answer
  • A network that typically reaches a few meters, such as up to 10 meters (33 feet), and consists of personal devices such as mobil
    14·1 answer
  • Templates contain common layout and formatting that can save you time by not having to recreate documents from scratch. True or
    10·1 answer
  • When a laptop internal device fails, what three options can you use to deal with the problem?
    7·1 answer
  • Custom Offers empower Sellers to upsell even higher than their Premium Packages—but when should a Custom Offer be used?
    12·1 answer
  • Jorge, a sports statistician for soccer, has kept track of how many shots-on-goal each player on a team made in each game. This
    9·1 answer
  • What is the importance of test documentation?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!