Skip to main content
Contents Index
Search Book
Search Results:
No results.
Read aloud
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 6.11 Write Code Questions
Activity 6.11.2 .
Fix the 5 errors in the code below to return a countdown of the numbers from 10 to 0, including 0.
Solution .
Fix the 5 errors in the code below to return a countdown of the numbers from 10 to 0, including 0.
Activity 6.11.3 .
The following code will loop way too many times. Change one line to make the loop only have five iterations.
Activity 6.11.4 .
Make 5 changes to the code below to correctly print a count up from -10 to 0, including 0.
Solution .
Make 5 changes to the code below to correctly print a count up from -10 to 0, including 0.
Activity 6.11.5 .
Finish lines 1 and 5 so that the following code correctly prints every integer from -5 to -1, including -1.
Activity 6.11.6 .
Complete the code on lines 4 and 6 so that it prints the number 6.
Solution .
Complete the code on lines 4 and 6 so that it prints the number 6.
Activity 6.11.7 .
Loading a select question (grading type: first)...
Activity 6.11.8 .
This function currently takes a start and stop argument and uses a for loop to find the sum of all the numbers between them (inclusive). Change the for loop to a while loop while still using the same parameters.
Solution .
This function currently takes a start and stop argument and uses a for loop to find the sum of all the numbers between them (inclusive). Change the for loop to a while loop while still using the same parameters.
Activity 6.11.9 .
The program below is supposed to print the times tables from 1 to 3, but there are 6 errors. Fix the errors.
Activity 6.11.10 .
The following code prints the times tables for 1 to 3 using two for loops. Rewrite the program to use a while and a for loop instead.
Activity 6.11.11 .
Loading a select question (grading type: first)...
You have attempted
of
activities on this page.