

Unit 5: JavaScript and Graphics 5.1-5.8
Presentation
•
Computers
•
8th - 9th Grade
•
Medium
Mattea Barnes
Used 3+ times
FREE Resource
20 Slides • 21 Questions
1
Unit 5: JavaScript & Control Structures
5.1-5.8

2
5.1 Booleans
Booleans refer to only two values and are used to test whether a specific condition is...
3
Multiple Select
A boolean is a ____ or ____ value.
true
false
yes
no
4
Question:
Describe how you would create a boolean variable that stores whether it is raining or not. What name would you give it? What value would you assign to it if it is raining?
5
Open Ended
Describe how you would create a boolean variable that stores whether it is raining or not. What name would you give it? What value would you assign to it if it is raining?
6
Poll
How confident are you in your understanding of booleans?
Super Confident
Somewhat Confident
No Confidence
7
5.2 Logical Operators
Logical operators allow you to connect or modify boolean expressions. There are three logical operators...
8
Fill in the Blanks
Type answer...
9
Fill in the Blanks
Type answer...
10
Fill in the Blanks
Type answer...
11
Review Questions
Answer the following questions about logical operators.
12
Multiple Choice
If the variable a is true, what is the value of !a?
True
False
13
Why is the answer false?
Let's discuss.
14
var a = true;
So !a is false.
a is now false because the ! in front of a means not, making it not true.
15
Multiple Choice
If the variable a is true and b is false, what is the value of a && b?
True
False
16
Why is the answer false?
Let's discuss.
17
If the variable a is true and b is false, what is the value of a && b?
The value is false because with the && logical operator, if both variables aren't true, then its value is false.
18
Multiple Choice
If the variable a is true and b is false, what is the value of a || b?
True
False
19
Why is the answer true?
Let's discuss.
20
If the variable a is true and b is false, what is the value of a || b?
The answer is true because if at least one value is true, then it's true. If they both have false, then it would be false.
21
Poll
How confident are you in your understanding of logical operators?
Super Confident
Somewhat Confident
With a little more practice, I'll have more confidence.
No Confidence
22
5.3 Comparison Operators
Comparison operators let you compare two values.
23
Multiple Select
Choose the correct comparison operators.
<=
>
=>
=
!=
24
Multiple Choice
12 >= 12
True
False
25
Multiple Choice
15 < 15
True
False
26
Multiple Choice
1 < 33
True
False
27
Multiple Choice
5 != 3
True
False
28
Poll
How confident are you in your understanding of comparison operators?
Super Confident
Somewhat Confident
With a little more practice, I'll have more confidence.
No Confidence
29
5.4 If Statements
If statements allow you to make decisions and execute specific code depending on the validity of a condition.
30
Fill in the Blanks
Type answer...
31
If Statements... let's discuss.
What are they?
Why are they useful?
How do you use them?
32
What is something you only do if you are wearing a helmet? What is something you only do if you are outdoors? Create propositional statements: “If __, then __”
If I'm wearing a helmet, then I am biking.
If I'm outdoors, then I am going on a run.
33
So what boolean value would hasHelmet be assigned if I wanted to ride a bike?
....
34
var hasHelmet = true;
35
Open Ended
Why do you think if statements are useful?
36
Poll
How confident are you in your understanding of If Statements?
Super Confident
Somewhat Confident
With a little more practice, I'll have more confidence.
No Confidence
37
5.5-5.7: For Loops
For Loops allow us to do something for a set number of times.
38
Multiple Choice
How would I correctly print out Hello three times using a for loop?
println("Hello");
println("Hello");
println("Hello");
for(i =0; i > 3; i++){
println("Hello");
}
for(i =0; i < 3; i++){
println("Hello");
}
for(i =0; i < 3; i--){
println("Hello");
}
39
Multiple Choice
This code represents walking by taking several steps. Rewrite this using a for loop:
leftFoot();
rightFoot();
leftFoot();
rightFoot();
leftFoot();
rightFoot();
for(i =0; i <3; i++){
leftFoot();
rightFoot();
}
for(i = 1; i < 3; i++){
leftFoot();
rightFoot();
}
for(i =0; i <3; i++){
leftFoot();
rightFoot();
leftFoot();
rightFoot();
}
40
If I wanted to print out the values 0 - 10, what would my for loop look like?
41
WHICH ANSWER?
for(var i = 0; i < 11; i++)
for(var i = 0; i <= 10; i++)
Unit 5: JavaScript & Control Structures
5.1-5.8

Show answer
Auto Play
Slide 1 / 41
SLIDE
Similar Resources on Wayground
39 questions
Rhetorical Devices with Appeal Review
Presentation
•
9th Grade
35 questions
Copyright (Unit 1.4)
Presentation
•
9th Grade
36 questions
Bohr Diagrams
Presentation
•
8th Grade
35 questions
Stars / HR Diagrams
Presentation
•
8th Grade
37 questions
Photosynthesis/Cellular Respiration
Presentation
•
9th Grade
35 questions
Client-Server & Peer-To-Peer Networks
Presentation
•
9th Grade
39 questions
INTERNAL STRUCTURE OF THE EARTH
Presentation
•
8th - 10th Grade
33 questions
Electromagnetic Waves
Presentation
•
9th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade