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
In GamePoints' constructor, assign teamWhales with 500 and teamLions with 500. #include using namespace std; class GamePoints {
xxMikexx [17]

Answer:

Here is the GamePoints constructor:

GamePoints::GamePoints() :

/* Your code goes here */

{

teamLions = 500;

teamDolphins = 500;

}    

Explanation:

Here is the complete program:

#include  //to use input output functions

using namespace std; //to identify objects like cin cout

class GamePoints {  //class GamePoints

   public: GamePoints(); // constructor of GamePoints class

   void Start() const;  //method of GamePoints class

   private: //declare data members of GamePoints class

   int teamDolphins; // integer type private member variable of GamePoints

   int teamLions; }; // integer type private member variable of GamePoints

   GamePoints::GamePoints()  //constructor

    { teamLions = (500), teamDolphins= (500); }   //assigns 500 to the data members of teamLions  and teamDolphins of GamePoints class

   void GamePoints::Start() const    { //method Start of classs GamePoints

       cout << "Game started: Dolphins " << teamDolphins << " - " << teamLions << " Lions" << endl; }  //displays the values of teamDolphins and teamLions i.e. 500 assigned by the constructor

       int main() //start of main() function

       { GamePoints myGame;  // creates an object of GamePoints class

       myGame.Start(); //calls Start method of GamePoints class using the object

       return 0; }

The output of the program is:

Game started: Dolphins 500 - 500 Lions                    

8 0
3 years ago
Write a Java program that accepts an integer number from the user between 20 and 100. Next, divide the number by 12 and determin
Eddi Din [679]
Import java.util.Scanner;
class hola
{
public static void main(String[]args)
{
Scanner x=new Scanner(System.in);
int a=x.nextInt();
int b;
if(a>20&&a<100)
{
b=a%12;
if(b%2==0){
System.out.print("es par"+b);
}
else{
System.out.print("es impar"+b);
}
}
}

}
4 0
4 years ago
Which of the following loop conditions will read all the data in the file assuming that each line in the file contains two integ
PSYCHO15rus [73]

Answer:

while(inFile >> intOne >> intTwo)

Explanation:

Options are missing but the line of code that does the illustration in the question is while(inFile >> intOne >> intTwo)

Considering two variables, intOne and intTwo

Suppose that a file location has been specified, the infile statement identifies file which could either be an external data or an in-stream data from which data should be read.

while(inFile >> intOne >> intTwo)

Declares a while loop, with the help of the inFile statement, values in the first column are entered into intOne while the second column are entered into intTwo through with the help of then input channel symbol (>>).

3 0
4 years ago
Discuss the major procedures that investigators must use in order to collect network trace evidence of computer-related crimes.
frez [133]

Answer:

The answer is below

Explanation:

The major procedures that investigators must use to collect network trace evidence of computer-related crimes include the following:

1. Establish appropriate guidelines to follow: before starting the actual investigation, all the legal procedures and instructions to follow must be clearly stated and shown to everybody involved in the investigation process.

2. Assess the Evidence: the investigators must assess all the available evidence by checking the computer through a specific means. The assessment includes checking of hard drives, email accounts, social networking sites, or similar digital prints that can be used as proof of the criminal activities

3. Acquire the Evidence: here the investigators must find an appropriate means of gathering the evidence formally and legally. This may involve the removal of any form of hardware such as hard drives, and software-related items that can be extracted.

4. Examine the Evidence: this involved examination of the acquired evidence, to determine if it can be used as proof or not. This involved analyzing the evidence to check if they correlate with the criminal activities under investigation. Some of the things to check include, date of formation of the evidence, the names attached to it, the routes those data were sent or received from, etc.

5. Prepare a report and document them appropriately: this involved the proper detailing and recording of the information derived from the evidence. It includes the time of evidence examination and methods used in examining them. Also, the means at which they acquired the evidence among others.

8 0
3 years ago
What does this result prove about the computer’s network connectivity?
Anna007 [38]
It can prove or disprove the fact that your computer is connected it the internet by in turn whether you can do almost anything
7 0
3 years ago
Other questions:
  • DG Loans, a mortgage lender, was charged with a discrimination lawsuit. It alleged that the company was offering loans at higher
    13·1 answer
  • You've been asked to find the average of a range of numbers. Which of the following could you use to find the average of cells A
    9·1 answer
  • Which other capabilities do many wireless access points have? Choose two answers.
    9·1 answer
  • What does the metric column in a routing table do?
    8·1 answer
  • Define time management and give two activities that you can do to help manage your tasks, homework, or projects better.
    12·1 answer
  • After fixing the format of her subheadings, she notices that she misspelled the name of one of the famous people
    7·2 answers
  • _____ is the practice of using the internet to provide healthcare without going to a doctor’s office or hospital.
    15·2 answers
  • What's the best thing that's happened to you during quarantine?
    10·2 answers
  • Lacking in movement, action, or change, especially in a way viewed as undesirable or uninteresting�
    12·1 answer
  • Identify the calculation performed by the following code.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!