IT102 If Else Statement Flashcards

1
Q

In java, selection statements are also known as ____________ or conditional or decision-making statements.

A

branching statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In java, ______________ are also known as branching statements or conditional or decision-making statements.

A

selection statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In java, selection statements are also known as branching statements or conditional or ______________

A

decision-making statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In java, selection statements are also known as branching statements or _______ or decision-making statements.

A

conditional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

These statements allow the program to execute different lines of code depending on the scenario, whether a particular condition is _______

A

true or false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

These statements allow the 1.______ to 2.___________ depending on the scenario, whether a particular condition is true or false.

A

1.program
2.execute different lines of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

These statements allow the program to execute different lines of code depending on the 1.______, whether a particular _____ is true or false.

A

1.scenario
2.condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

It is used to select part of a program to be 1._____ based on 2.______.

A

1.executed
2.condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

It is used to select part of a _____ to be executed based on condition.

A

program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

These are vital for controlling the 1.__________ that enables the developers to create the logic that can respond dynamically to the 2._____ or the 3.____,which further helps in making the 4._____ more 5.____ and 6.____.

A

1.flow of a program
2.data
3.input
4.program
5.powerful
6.flexible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

There are ______ types of Java conditional statements.

A

five

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the five types of Java conditional statements.

A
  1. Java If Statement
  2. Java If-Else Statement
  3. Java If-Else-If Ladder Statement
  4. Java Nested If Statement
  5. Java Switch Statement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

_______ is the most simple decision-making statement.

A

IF statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

IF statement is the ____________ statement.

A

most simple decision-making

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

IF statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be 1._________ i.e. if a certain condition is 2.___ then a block of statements is executed otherwise not.

A

1.executed or not
2.true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Suppose a condition is 1.____ if a statement is used to run the program. It is also known as a 2._____ statement. If a condition is used, an argument is 3.____, and if it is 4.____, the corresponding code is 5._____; otherwise,6._______.

A

1.true
2.one-way selection
3.passed
4.satisfied
5.executed
6.nothing happens

17
Q

if condition evaluates to 1.___, statements are 2.______.
if condition evaluates to 3._____, statements are 4.____

A

1.true
2.executed
3.false
4.skipped

18
Q

In Java, we use the 1._____ statement to 2.___________ and 3._______ of a block of statements out of 4._____ based on that 5.______.

A

1.if-else
2.test a condition
3.pick the execution
4.two blocks
5.condition result

19
Q

The 1._________ checks the given 2._____ and then decides which block of statements to 3.____ based on the condition 4.____.

A

1.if-else statement
2.condition
3.execute
4.result

20
Q

If the condition is 1._____,then the _____ block of statements is 2._____ and if it is 3._____, then the _____ block of statements is 4.____.

A

1.True
2.executed
3.False
4.executed

21
Q

Be careful with the placement of 1.___________. They define the 2.___________ and can affect the 3._________.

A

1.curly braces {}
2.scope of the code blocks
3.program’s logic

22
Q

If the condition is True,then the 1.____________ is executed and if it is False, then the 2.____________ is executed.

A

1.true block of statements
2.false block of statements

23
Q

the program will do one task (codes inside if block) if the condition is 1.____ and another task (codes inside else block) if the condition is 2.______.

A

1.true
2.false