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
Bess [88]
3 years ago
5

When do you use an else statement?

Computers and Technology
1 answer:
tatiyna3 years ago
8 0

Answer:

To tell what will happen when an if-statement is false

Explanation:

We use else statement if if-statement get false.

for example

if(a>20)

{

print "your age is greater than 20"

}

else

{

print "Your age is less than 20"

}

In the pseudo code, you see the use of else statement, that if age is greater than 20 then display message "you are age is greater than 20". if this statement get false, i.e. you are age is not greater than 20 then else statement will be executed and message will be displayed that your age is less than 20.

Why other option are not correct

To input a variable:

to get input, we use input statement of respective programming language not if-else statement.

To end an if statement

we don't use else statement to end if statement. when condition met then if statement will be ended

To handle string value

we use input validation statement to handle if statement.

You might be interested in
Java variable is the name of a Group of answer choices numeric data value stored in memory data value stored in memory that can
artcher [175]

Answer:

Java variable is the name of a group of data value stored in memory that can change its value but cannot change its type during the program's execution

Explanation:

Generally, a variable is a temporary location in the memory where data are stored in a computer program. Values in the variable can always be change during the course of program execution.

The equal sign ( = ) is use to assign and identify a variable. The value to be stored in the variable is always at the right of the equal sign, while the variable name is always at the left of the equal sign.

5 0
3 years ago
What peripheral displays us the image on a computer?​
zhenek [66]

Answer:

The monitor. It can be a CRT,LCD or LED monitors

Explanation:

Hope it helps

6 0
3 years ago
84.6% complete question a network administrator is installing a device that uses redundant array of independent disks (raid) tec
Alja [10]

The device that this network administrator is most likely installing in the infrastructure is a Network Attached Storage (NAS).

<h3>What is a Network Attached Storage (NAS)?</h3>

A Network Attached Storage (NAS) can be defined as a file-dedicated storage device that is designed and developed to enable multiple end users and other heterogeneous client devices to store, share and retrieve data anywhere from a centralized disk, especially through a network.

In this context, we can infer and logically conclude that a Network Attached Storage (NAS) is the device that this network administrator is most likely installing in the infrastructure because it doesn't require licensing and the data stored on it at the file level can be accessed anywhere.

Read more on Network Attached Storage here: brainly.com/question/14456295

#SPJ1

3 0
2 years ago
Write a Comparator that compares String objects by the number of words they contain. Consider any nonwhitespace string of charac
Readme [11.4K]

Answer:

import java.util.Scanner;

public class num12 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter the first String");

       String word1 = in.nextLine();

       System.out.println("Enter the second String");

       String word2 = in.nextLine();

       System.out.println("Enter the third String");

       String word3 = in.nextLine();

       //Remove all white spaces

        String cword1 = word1.replace(" ","");

       String cword2 = word2.replace(" ","");

       String cword3 = word3.replace(" ","");

       //Comparing the string by their lengths

       if(cword1.length()>cword2.length()&&cword1.length()>cword3.length()){

           System.out.println(word1+" Is the longest");

       }

       else if(cword2.length()>cword1.length()&&cword2.length()>cword3.length()){

           System.out.println(word2+" Is the longest");

       }

       else{

           System.out.println(cword3+" Is the longest");

       }

   }

}

Explanation:

Using Java Programming Language

Use the Scanner Class to obtain the String values from the user

Save them in different variables

Use the replace() method in java to remove white space from any of the string entered

Using if and else statements compare the lengths of the strings (word.length()) returns the length of the word.

Print out the word that is longest

NOTE I have compared three Strings, comparing two would have been more straigth forward

8 0
4 years ago
If x has a value of 7 and y has a value of 20, what is displayed as a result of executing the code segment
Llana [10]

<em>6.65 </em><em>is displayed as the</em><em> output </em><em>of the </em><em>block of code</em>

<em />

In python programming, * denotes multiplication. To get the output, we will substitute the value of x and y given into the result to have;

<em> result = x * y - x / (y)</em>

<em> result = 7 * 20 - 7 / (20)</em>

<em> result = 140 - 7 / (20)</em>

<em> result = 133/20</em>

<em> result = 6.65</em>

<em />

<em>This shows that </em><em>6.65 </em><em>is displayed as the</em><em> output </em><em>of the </em><em>block of code</em>

<em />

The question is incomplete;

Let the code segment be

<em>>>> x = 7 </em>

<em>>>> y = 20   </em>

<em>>>> result = x * y - x / (y) </em>

<em>>>> result  </em>

<em>output:__?</em>

<em />

Learn more here: brainly.com/question/24240957

5 0
2 years ago
Other questions:
  • Define scanning and why it’s considered one of the most important phases of intelligence gathering for an attacker. Also discuss
    10·1 answer
  • Can using interior light help improve a drivers visibility at night
    9·1 answer
  • Which of the following is considered part of the process in the systems thinking example of a TPS?
    6·1 answer
  • The Printer Event 1 P1 requests and is allocated the printer R1. 2 P1 releases the printer R1. 3 P2 requests and is allocated th
    10·1 answer
  • Which task is performed by the artificial intelligence programmer?
    7·1 answer
  • While these two approaches have similarities in terms of the topics they address, ________ will cover broad IT management topics
    7·1 answer
  • Why we called COBOL as a professional language and not ataught language.(
    13·1 answer
  • What does the memory controller prevent
    5·2 answers
  • In which of the following work situations would word processing software be most appropriate to make the task easier?
    6·1 answer
  • What can a user modify on a business card using the Edit Business card in the dialog box?​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!