IF ELSE IF LADDER STATEMENT Flashcards

1
Q

The 1. _______ ladder is a sequence of if conditions that check various possibilities in a 2._______. It’s useful when you have 3.______ to check.

A
  1. if-else-if
    2.cascading manner
    3.more than two possibilities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Test Expression 1:

The program starts by evaluating the 1._______

If 2.____, it 3.______ Statement 1 and 4.____

If 4._____, it moves to the 6._____.

A

1.first condition.
2.true
3.executes
4.exits the ladder.
5.false
6.next condition

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

Test Expression 2:

If the 1.______ was 2.____, this condition is 3._____.

If 4.______, it 5._________ and 6.____.• If 7.____, it moves to the 8.______.

A

1.first condition
2.false
3.evaluated
4.true
5.executes Statement 2
6.exits the ladder
7.false
8.next condition

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

Test Expression 3:

If the 1.________ were 2.____, this condition is 3.____.

If 4._____, it 5.______ and 6._____.

If 7._______, it moves to the 8.______.

A

1.first two conditions
2.false
3.evaluated
4.true
5.executes Statement 3
6.exits the ladder
7.False
8.Body of else

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

Body of else:

If 1.___ of the previous conditions were 2.____, the code within this block is executed.

Statement just below 3.____

Regardless of which condition was 4.______,this statement is always 5.____.

A

1.none
2.true
3.if-else-if
4.true or false
5.executed

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

It ensures that only 4._______________, the one corresponding to the 5.________.

If 6._________, the code in the 7._________.

A

4.one block of code is executed
5.first true condition
6.none of the conditions are true
7.else block is executed

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

The 1._____ is a 2._____ for 3._______ in programming.

It’s important to order the conditions 4.______ to ensure the 5.________ is executed.

The else block is 6._____, but it’s often used to 7.______ where none of the conditions are met.

A

1.if-else-if ladder
2.versatile tool
3.making decisions
4.logically
5.correct block of code
6.optional
7.handle cases

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

A 1.______ means placing an 2.________. This is used when you need to 3.________ in layers. For example, you might check an initial condition, and if it’s true, move deeper into another condition.

A

1.nested if
2.if statement inside another if
3.test multiple conditions

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

Outer If Condition

The program starts by evaluating the 1.________.

If the condition is 2._____, the flow moves to the Code 3.______.

If the condition is 4._____, the 5.____ directly moves to the Code after the outer if statement.

A

1.Outer If Condition
2.true
3.inside the outer if statement
4.false
5.flow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Inner If Condition:

If the Outer If Condition was true, this inner condition is evaluated.

If the 1.______ is 2.____, the flow reaches the Code 3.________.

If the 4.________ is 5._____, the flow directly moves to the Code 6._________.

A

1.Inner If Condition
2.true
3.inside the inner if statement
4.Inner If Condition
5.false
6.after the outer if statement

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

The 4.______ condition acts as the 5._________.

If the 6.________ is 7._____, a 8.______ condition is evaluated to determine the next course of action.

If either the outer or inner condition is 9.___, the program moves to the 10._________.

A

4.outer if
5.primary decision point
6.outer condition
7.true
8.nested if
9.false
10.final block of code

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

You can nest multiple if statements within each other to create ___________.

A

complex decision-making structures

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

1._____ helps in 2.______ the nesting levels and makes the code more 3._____.

A

1.Indentation
2.visualizing
3.readable

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

Use 1._____ and 2.______ variable names to improve code understanding.

A

1.clear
2.descriptive

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

Consider using 1._______ (&&, ||, !) to 2.______ within if statements.

A

1.logical operators
2.combine conditions

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

The 1._______ method is a tool for comparing 2._____ without considering 3._____. It returns a 4._______:

A

1.equalsIgnoreCase()
2.strings
3.case sensitivity
4.boolean value

17
Q

1.____: If the 2.____ are equal, 5._____

3._____: If the strings are 4._____, even after ignoring case.

A

1.true
2.two string
3.false
4.not equal
5.ignoring case differences.

18
Q

In Java, a 1._________ is when you have an 2._____ inside another if or else block. It’s like placing one decision within another decision.You use this when you want to check for a 3.______ after a 4.________ has already been found 5.______.

A

1.nested if-else statement
2.if-else block
3.new condition
4.previous condition
5.true (or false)

19
Q

Outer If-Else:

The 1.______ is 2.______.

If 3._____, the code inside the 4._______.

If 5.______, the code inside the 6.______

A

1.first condition
2.checked
3.true
4.outer if block runs
5.false
6.outer else block runs.

20
Q

Nested If-Else:

These are found within the outer 1.______.

They follow the same logic as the 2._____:

A condition is 3.____.

If 4.____, the code inside the 5.______.

If 6._____, the code inside the 7.________.

A

1.if or else block
2.outer if-else
3.checked
4.true
5.nested if block runs
6.false
7.nested else block runs

21
Q

Selection statements, including if, if-else, if-else-if ladder, nested if, and nested if-else, are 1.__________ for 2._____ based on 3.______. These statements allow you to control the flow of your program, making it more 4._____ and 5.______. By understanding and effectively using these constructs, you can create more 6._____ and 7.________ that can adapt to various 8.______ and 9______.

A

1.fundamental tools in programming
2.making decisions
3.specific conditions
4.dynamic
5.responsive
6.complex
7.intelligent applications
8.input
9.scenarios

22
Q

Selection statements, including if, if-else, if-else-if ladder, nested if, and nested if-else, are 1.__________ for 2._____ based on 3.______. These statements allow you to control the flow of your program, making it more 4._____ and 5.______. By understanding and effectively using these constructs, you can create more 6._____ and 7.________ that can adapt to various 8.______ and 9______.

A

1.fundamental tools in programming
2.making decisions
3.specific conditions
4.dynamic
5.responsive
6.complex
7.intelligent applications
8.input
9.scenarios

23
Q

The 1.____ provides a 2.____ to check 3.____.

A

1.if-else-if ladder
2.sequential way
3.multiple conditions

24
Q

The 1.____ provides a 2.____ to check 3.____.

A

1.if-else-if ladder
2.sequential way
3.multiple conditions

25
Q

The 1._____ depicts a 2._______ process with 3._________.

A

1.flowchart
2.decision-making
3.two levels of conditions