Search Header Logo
Conditional Structures in Arduino

Conditional Structures in Arduino

Assessment

Presentation

Computers

10th Grade

Practice Problem

Medium

Created by

Ruby Español

Used 16+ times

FREE Resource

19 Slides • 8 Questions

1

media

2

media

3

media

4

media

5

media

6

media

7

media

8

media

9

media

10

Multiple Choice

Which of the following is not true about a condition in Programming?

1

It's either true or false

2

usually made up by relational operator, but not all the time

3

the state of something with regard to its appearance, quality, or working order.

4

We use it in places such as if, for, and while, these control statements will only run when the condition is true

11

media

12

media

13

media

14

media

15

Multiple Choice

Which statement best describes an if condition?

1

It repeats actions forever

2

It stores values in memory

3

It checks if something is true before doing an action

4

It sends data to the cloud

16

Multiple Choice

Question image

What will this code do?

1

The LED turns off when the button is pressed

2

The LED blinks continuously

3

The LED turns on when the button is pressed

4

Nothing happens

17

Fill in the Blank

Type the correct syntax for an if statement that checks if a sensorValue is greater than 100.

(
>
)
{
}

18

media

19

media

20

media

21

Multiple Choice

An if statement always requires an else part.

1

TRUE

2

FALSE

22

Multiple Choice

You want your Arduino to display “Too Hot” when the temperature is above 30°C and “Normal” otherwise. Which is correct?

1

if (temp >= 30)

{

Serial.println("Too Hot");

}

else {

Serial.println("Normal"); }

2

if (temp > 30) {

Serial.println("Too Hot"); }

else {

Serial.println("Normal"); }

3

else (temp < 30) { Serial.println("Normal"); }

4

if (temp == 30) {

Serial.println("Normal"); }

23

Fill in the Blank

Question image

Complete the if-else structure to turn the LED on when the button is pressed, and off otherwise.

(
,
)

24

media

25

media

26

Open Ended

In real life, we often face situations where we must decide based on conditions — just like in if-else coding. Can you share a moment where you had to make a fair or right decision based on a condition?

27

media
media

Show answer

Auto Play

Slide 1 / 27

SLIDE