Search Header Logo

Code Tracing Quiz

Authored by Thanh Le

Computers

9th - 12th Grade

Used 2+ times

Code Tracing Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of tracing code?

To create charts for code segments

To execute loops

To write code more efficiently

To track variables and output for troubleshooting logic errors

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the first step in tracing the execution of a loop?

Create a chart with columns for variables and output

Initialize the loop control variable

Display the output after the loop

Add the values for each variable for each iteration

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the first code segment, what is the value of sum after the loop?

0

10

6

15

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the second code segment, what is the output after the loop?

1, 2, 3, 4, 6, 12

12

1, 2, 3, 4, 6

12, 1, 2, 3, 4, 6

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the initial value of fact in the second code segment?

2

0

12

1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output after the loop in the second code segment?

12, 1, 2, 3, 4, 6

1, 2, 3, 4, 6

1, 2, 3, 4, 6, 12

12

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of sum after the loop in the first code segment?

0

6

15

10

Access all questions and much more by creating a free account

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

Already have an account?