unit 4 code.org test

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:37 AM on 3/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards
<p>What number will be output by the console.log command on line 7?</p>

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

100

2
New cards
<p>What number will be output by the console.log command on line 5?</p>

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

16

3
New cards
<p>What number will be output by the console.log command on line 5?</p>

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

35

4
New cards
<p>What text will be output by the program?</p>

What text will be output by the program?

30 or more

5
New cards
<p>What text will be output by the program?</p>

What text will be output by the program?

Output D

6
New cards
<p>What will be the order of letters printed to the console when this program is run?</p>

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

a b c b c

7
New cards
<p>"You win!" never displays. What change would fix this issue?</p>

"You win!" never displays. What change would fix this issue?

Line 3 - remove var

8
New cards
<p>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?</p>

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

9
New cards
<p>This function chooses the screen to display based on the score. What is the correct way to call this function?</p>

This function chooses the screen to display based on the score. What is the correct way to call this function?

checkWin ( ) ; →

10
New cards

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);

}

}

11
New cards

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;

}

12
New cards

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;

}

13
New cards
<p>What will the value of the variable bags be at the end of the flowchart shown here?</p>

What will the value of the variable bags be at the end of the flowchart shown here?

2

14
New cards

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

15
New cards

Which of the following is true of functions?

Functions can help remove repeated code from a program