1/53
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Affects the sequential flow of control by executing different statements based on the value of a Boolean expression.
Conditional Statement
Stores information as a number, String, or Boolean.
Variable
Joins together two or more strings end-to-end to make a new string.
Concatenation
An ordered sequence of characters.
String
True
What is the Output of this Flowchart?

"Looking Fresh"
What is the Output of this Flowchart?

90
32.2
What is the Output of this Code?

100
What is the Output of this Code?

Change the line with "var y = y + 1" to
y = y + 1
Y is less than 6" never displays to the console. How would you change the code to fix this?

Classical
What is the Output of this Code?

"no you cannot get a cat"
What is the Output of this Code?

True
False
False
False
&& operator - Write the Output for each expression
true && true =
true && false =
true && false =
false && false =
True
True
True
False
|| operator - Write the Output for each expression
true || true =
true || false =
false || true =
false || false =
False
True
! operator - Write the Output for each expression
!true =
!false =
A named group of programming instructions. Also referred to as a "procedure".
Function
A command that executes the code within a function.
Function Call
1. Functions can help remove repeated code from a program
2. Functions are declared once
True Statements about functions -
1. Programs with functions run more quickly
2. Functions can only be called once
3. Replacing repeated code with a function will reduce the number of commands the computer needs to run
False Statements about functions -
"a"
"b"
"c"
"b"
"c"
What is the output of this Code?

D). x = 3, y = 2, z = 1
Answer The Question

B). The program will be easier for people to read.
D). The programs will be easier to modify in the future.
Answer The Question

D). (num MOD 2) = 1
Answer The Question

false
false
false
Answer The Question

true
(t/f) Variables update line by line.
false
(t/f) Typing "var" before a word only updates a variable.
the last line that is true
What line of an if statement will show in a console.log area?
true
(t/f) A number added to a variable updates it line by line.
true
(t/f) The else statement at the end of an if else only executes if everything else is false.
name, number, variable
Updating a variable gives the variable a new...?
how many times they are called
How many times do functions execute?
in a declared function
Where should you put lines of code that are repeated in an on event?
false
(t/f) It does not matter in what order lines of code are entered.
the same name as the declared function
What name is used to call a function?
equals
What does == mean in code?
false
(t/f) The most limiting statement should come last in code.
they help eliminate repeated code.
why create functions in code?
false
(t/f) && means "or"
conditionals
What statements are executed in sequential order based on the value of Boolean expressions?
true
(t/f) A flow chart is used to trace the path of Boolean expressions.
What number will be output by the console.log command on line 7?
100

What number will be output by the console.log command on line 5?
16

What number will be output by the console.log command on line 5?
35

What text will be output by the program?
30 or more

What text will be output by the program?
Output D

What will be the order of letters printed to the console when this program is run?
a b c b c

"You win!" never displays. What change would fix this issue?
Line 3 - remove var

When this function is called, the smaller of two numbers is displayed. What Boolean expression would not work in line 12 in order to accomplish this goal?
num1 == num2

This function chooses the screen to display based on the score. What is the correct way to call this function?
checkWin ( ) ; →

There is repeated code in these onEvent blocks. Choose the correct code for the updateScreen() function which would be called in each of the onEvent blocks.
function updateScreen() {
setText("counter_label", "counter");
if (counter == 0) {
setProperty("counter_label", "font-size", 24);
}
}
A movie theater charges different ticket prices based on a customer's age. The prices are shown in the table below.
The customer's age is stored in the variable age and the price is stored in the variable price. Which piece of code will correctly decide the price for each ticket.
if (age >= 65) {
price = 6;
} else if ((age > 12)) {
price = 8;
} else {
price = 5;
}
A museum charges different prices based on the day of the week and age of the visitor. The pricing rules are shown below.
On Tuesday and Thursday children 10 and under get in free ($ 0).
For all other days and ages the cost is ten dollars ($ 10).
The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is stored in the variable price. Which piece of code will correctly decide the price for each ticket.
if ((day == "Tuesday" || day == "Thursday") && (age <= 10)){
price = 0;
} else {
price = $10;
}
What will the value of the variable bags be at the end of the flowchart shown here?
2

Choose the correct definition for Conditional Statement
affects the sequential flow of control by executing different statements based on the value of a Boolean expression
Which of the following is true of functions?
Functions can help remove repeated code from a program