Code Tracing Quiz

Code Tracing Quiz

9th - 12th Grade

11 Qs

quiz-placeholder

Similar activities

Functions in Python

Functions in Python

9th - 12th Grade

16 Qs

Arduino IDE

Arduino IDE

3rd Grade - Professional Development

17 Qs

Unit 4 AP CSA Review

Unit 4 AP CSA Review

12th Grade

13 Qs

10.4 Python Lists

10.4 Python Lists

7th - 10th Grade

14 Qs

Python Iteration

Python Iteration

10th Grade

17 Qs

C ++ For Loop

C ++ For Loop

9th - 12th Grade

14 Qs

Subroutines

Subroutines

9th - 11th Grade

16 Qs

Python strings

Python strings

8th - 9th Grade

11 Qs

Code Tracing Quiz

Code Tracing Quiz

Assessment

Passage

Computers

9th - 12th Grade

Hard

Created by

Thanh Le

Used 1+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?