Lesson 5 While Loops

Lesson 5 While Loops

6th - 8th Grade

12 Qs

quiz-placeholder

Similar activities

Recuperação da Prova PR

Recuperação da Prova PR

8th Grade

10 Qs

Quiz 8 (01.09.2021)

Quiz 8 (01.09.2021)

1st - 12th Grade

10 Qs

Digcit 5-6

Digcit 5-6

5th - 6th Grade

10 Qs

Year 7 - Bohunt E-Mail

Year 7 - Bohunt E-Mail

7th Grade

10 Qs

Internet Vocabulary

Internet Vocabulary

7th - 9th Grade

12 Qs

Основы программирования на языке Паскаль

Основы программирования на языке Паскаль

8th - 11th Grade

10 Qs

Understanding Computers #2 the CPU

Understanding Computers #2 the CPU

8th Grade

10 Qs

Manejar Objeto Power Point

Manejar Objeto Power Point

6th - 8th Grade

10 Qs

Lesson 5 While Loops

Lesson 5 While Loops

Assessment

Quiz

Computers

6th - 8th Grade

Medium

Used 35+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When is the best time to use a while loop in your code?
A. When you know exactly how many times you need the loop to repeat
B. When you have random elements in your puzzle with a repeating pattern
C. There are no identifiable patterns in a puzzle and you need simple commands
D. Whenever you are going to use a function in your coding solution

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What is the difference between a while loop and a for loop?
A. For loops can use conditional statements and while loops cannot
B. While loops repeat a set number of times and for loops repeat until their condition    is false
C. For loops repeat a set number of times and while loops repeat until their condition is   false
D. For loops can be used in a function and while loops cannot

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct example of a while loop?
A. for i in 1…4 {   turnLeft()   moveForward()   toggleSwitch()   }
B. while isOnClosedSwitch {   toggleSwitch()   turnLeft()   moveForward()   }
D. if isOnClosedSwitch {   toggleSwitch()   turnLeft()   moveForward()
C. while i in 1…4 {   toggleSwitch()   turnLeft()   moveForward()   }

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about using a while loop in your code?
A. while loops can only have one condition [no additional conditions can be added]
 B. while loops stop running after their condition is false [Boolean]
C. while loops stop running after they repeat the number of times you assigned
 D. while loops are not as efficient as for loops

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct example of a while loop inside of a function?
A. func while switchAndToggle {   if isOnGem {     collectGem()   moveForward()   }   }
B. while switchAndToggle {   if isOnGem {   collectGem()   moveForward()   }   }
C. func switchAndToggle {   if isOnGem {   collectGem()   moveForward()   }   }
D. func collectAndMoveForward {   while isOnGem {   collectGem()   moveForward()   }   }

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is a for loop more controlled than a while loop?
A. A for loop only repeats the number of times you tell it to
B. A for loop can be used inside of a function
C. A for loop can be repeated as many times as you use it in code
D. A for loop can contain more commands than a while loop

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct example of a for loop?
A. while for i in 1…4 {   moveForward()   collectGem()   }
B. func for i in 1…4 {   moveForward()   collectGem()   }
C. for i in 1…4 {   moveForward()   collectGem()   }
D. while isOnGem {   moveForward()   collectGem()   }

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?