Understanding Conditional Statements

Understanding Conditional Statements

Assessment

Flashcard

Computers

7th Grade

Practice Problem

Easy

Created by

Todd Schipper

Used 1+ times

FREE Resource

Student preview

quiz-placeholder

14 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the role of the 'if' statement in programming?

Media Image

Back

To execute code based on a condition

2.

FLASHCARD QUESTION

Front

What will be the output of the following JavaScript code?
```javascript
let numA = 4;
let numB = 10;
if (numA > numB) {
console.log('Number A is greater than number B.');
} else {
console.log('Number B is greater than number A.');
}
```

Back

Number B is greater than number A.

3.

FLASHCARD QUESTION

Front

The else block in a conditional statement executes when the if condition is _____.

Media Image

Back

false

4.

FLASHCARD QUESTION

Front

In the given code, what is the value of numA? Options: 5, 10, 15, 20

Media Image

Back

10

5.

FLASHCARD QUESTION

Front

What is the output of the program when numA and numB are both 10? Options: 'Number A is greater than Number B.', 'Number A is equal to Number B.', 'Number A is less than Number B.', 'Number B is greater than Number A.'

Media Image

Back

'Number A is equal to Number B.'

6.

FLASHCARD QUESTION

Front

Fill in the blank: The 'else if' condition is checked if the 'if' condition is ______.

Media Image

Back

false

7.

FLASHCARD QUESTION

Front

Fill in the blank: The 'if' statement is used to check the ______ condition.

Media Image

Back

first

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?