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
Hunter-Best [27]
4 years ago
13

"Consider the following code snippet: int number = 0; Scanner in = new Scanner(System.in); System.out.print(""Enter a number: ""

); number = in.nextInt(); if (number > 30) { . . . } else if (number > 20) { . . .. } else if (number > 10) { . . . } else { . . . } Assuming that the user input is 40, which block of statements is executed?
a. if (number > 30) { . . .}
b. else if (number > 20) { . . .}
c. else if (number > 10) { . . .}
d. else { . . .}
Computers and Technology
1 answer:
Bad White [126]4 years ago
3 0

Answer:

if (number > 30) {. . .}

Explanation:

This code block uses a simple if-elseif-else control structure to do a comparison on a value.  In this type of control structure, each operation of control is check until the correct condition is met, and once the code executes, it exits the control structure, never touching the remainder of the structure.

In this example, we are fortunate that the value triggers the first part of the control structure with if (number > 30) and will execute that section of code.  Once the code finishes, it will exit the structure, never making it to the other 3 control conditions.

Cheers.

You might be interested in
Point out any special purpose programminglanguage and also for what purpose it wasdeveloped.
cricket20 [7]

Answer: Lisp which is the short for list processing is a special purpose programming language and it was developed for processing strings which is being exploited in the field of artificial intelligence.

Explanation:

Lisp is used for artificial intelligence as it can compute symbolic expressions, so a common lisp which it later came to be known as is used for development of application with artificial intelligence and is being widely used today. Lisp was actually developed in the early 1980s.

3 0
4 years ago
Logical design is tied to a specific hardware and software platform. a. True b. False
cluponka [151]

Answer:B false

Explanation:

3 0
3 years ago
What feature of modern productivity tools makes it possible for files created in one software product to be opened in another so
aksik [14]

Answer:

File-exchange compatibility.

Explanation:

File exchange compatibility is the aspect of modern productivity apps that allows files generated in a software package to also be accessed from another software product.

In other words, it is that type of feature by which the user creates any file in his desktops software then that file is also compatible with another desktop or any other software also.

6 0
3 years ago
C
Paraphin [41]
The answer is Document Inspector
5 0
3 years ago
Write a custom exception class called ParameterNotAllowedException that contains the following: 1. An integer instance variable
jeyben [28]

Answer:

See explaination

Explanation:

//class extends Exception

class ParameterNotAllowedException extends Exception {

//Instance variable

private int input;

//Argumented constructor

public ParameterNotAllowedException(String message, int input) {

super(message);

this.input = input;

}

public int getInput() {

return input;

}

public void setInput(int input) {

this.input = input;

}

atOverride // Replace the "at" with at symbol ie shift 2

public String getMessage() {

//Returns the message

return input+" is invalid. "+super.getMessage();

}

}

class Main {

public static void main(String[] args) throws ParameterNotAllowedException {

int n = -1;

//Throw negative not allowed exception

if(n<0){

throw new ParameterNotAllowedException("negative number",n);

}

}

}

7 0
4 years ago
Other questions:
  • Monica needs a printer to use at home. She wants fine-quality prints at an affordable cost. Which printer will help her achieve
    9·1 answer
  • Which of the following would an interactive media proffessional must likely need
    9·1 answer
  • List seven basic internal components found in a computer tower
    13·1 answer
  • Which of the following is a scam where perpetrators promise high pay for working on different projects like wooden calendars, pa
    13·1 answer
  • Which behavior demonstrates teamwork
    8·2 answers
  • When you declare a variable of a basic, primitive type, such as int x = 10;, the memory address where x is located holds the ___
    12·2 answers
  • Based on the details in The Riddle of the Rosetta Stone, how did the career of Jean-Baptiste Fourier differ from that of Jacques
    9·2 answers
  • Win10如何删除自己添加的环境变量?...............
    8·1 answer
  • How does a Cloud-first strategy approach a client's migration to the Cloud?by removing outside ecosystem partners from the Cloud
    14·1 answer
  • list three things that can spoil a printer if they are not of the correct specification and explain what damage may be caused​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!