Skip to main content
Contents
Search Book
Search Results:
No results.
Readability settings Prev Up Next Scratch ActiveCode Profile
title here
\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 16.8 Review - Statements
Practice distinguishing between different types of statements and understanding what each line of code does.
Subsection 16.8.1 Part A: Recognize
Checkpoint 16.8.1 .
Label each code example as one of the following: assignment statement, function call statement, conditional statement, loop statement, or expression.
x = 5
print("Done")
if score > 70:
for num in numbers:
x + 2
Subsection 16.8.2 Part B: Explain
Checkpoint 16.8.2 .
Explain in words what each line does:
count = count + 1
print(name)
total = price * quantity
if age >= 18:
Subsection 16.8.3 Part C: Fix
Checkpoint 16.8.3 .
Reorder the following lines so they form a logical program that runs without errors.
Subsection 16.8.4 Part D: Create
Checkpoint 16.8.4 .
Write a 4-line program that displays a message that includes a personβs name and age. The program must create the following variables
name, and
age, and then create the variable
message using
name and
age, and then prints the message.
Subsection 16.8.5 Think About ...
Checkpoint 16.8.5 .
Why is it important for program statements to appear in the correct order?
You have attempted
of
activities on this page.