What is LessonUp
Search
Channels
AI tools
Log in
Register
‹
Return to search
Logic and Flow Control
Logic and Flow Control
1 / 14
next
Slide 1:
Slide
Computer Science
9-12 Grade
This lesson contains
14 slides
, with
interactive quizzes
and
text slides
.
Start lesson
Save
Share
Print lesson
Items in this lesson
Logic and Flow Control
Slide 1 - Slide
What is Flow Control?
Flow control is how a computer moves from one task to another.
if-else
while
for
condition
Slide 2 - Slide
If-Else Statement
If-Else tells the computer, IF something is true, do something, ELSE, do something ELSE.
Slide 3 - Slide
Slide 4 - Slide
While Loop
A while loop tells the computer to do something WHILE a condition is true.
Slide 5 - Slide
Slide 6 - Slide
For Loop
A for loop tells the computer to do something a specific number of times.
Slide 7 - Slide
Slide 8 - Slide
***Logical Operators ***
Logical operators tell the computer how to work with conditions.
Logical AND (
&&
) - Returns TRUE if both sides of the operator are true.
ex ( true && true) = TRUE
Logical OR (
||
) - Return TRUE if any side of the operator is true.
ex (true || false) = TRUE
ex (false || true) = TRUE
Logical NOT(
!
) - Returns the Opposite.
ex (true) = FALSE
ex (false) = TRUE
Slide 9 - Slide
What is flow control?
A
The flow of if-else statements.
B
Flow control turns on the computer
C
A way to guide program execution.
D
Two or more logical operations
Slide 10 - Quiz
Which keyword tells the computer to loop as long as a condition is true?
A
While
B
If
C
Switch
D
&&
Slide 11 - Quiz
Which keyword tells the computer to do something, given that a condition is true
A
Int
B
Boolean
C
If
D
Break
Slide 12 - Quiz
When using the AND (&&) operator, how many parts of the condition must be True to pass?
A
One
B
Two
C
None
D
All
Slide 13 - Quiz
When using the Or (||) operator, how many parts of the condition must be True to pass?
A
One
B
Two
C
None
D
All
Slide 14 - Quiz
More lessons like this
UV - Van Gogh's friend (1)
May 2023
-
14 slides
Art and design
Science
+2
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
Van Gogh Museum
True or false? The Bedroom
April 2022
-
23 slides
Art and design
Primary Education
Van Gogh Museum
True or false? The Yellow House
August 2022
-
23 slides
Art and design
Primary Education
Van Gogh Museum
School rules: true or false?
September 2025
-
13 slides
New lesson editor
Citizenship
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
BTEC, GCSE
LessonUp Inspiration
News Quiz - Week 37 (10 seconds)
September 2024
-
15 slides
Pubquiz
LessonUp
+4
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
LessonUp News Quiz
News Quiz - Week 37 (30 seconds)
November 2024
-
15 slides
Pubquiz
LessonUp
+4
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
News Quiz - Week 37 (30 seconds)
September 2024
-
15 slides
Pubquiz
LessonUp
+4
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
LessonUp News Quiz
News Quiz - Week 37 (20 seconds)
September 2024
-
15 slides
Pubquiz
LessonUp
+4
Primary Education
Lower Secondary (Key Stage 3)
Upper Secondary (Key Stage 4)
LessonUp News Quiz