<section xml:id="section-interactive-exercises" label="section-interactive-exercises">
<title>Interactive Exercises</title>
<introduction>
<p>
Interactive components, <em>just</em>
for testing, no commentary.
</p>
</introduction>
<exercises>
<title>True/False</title>
<introduction>
<p>
A True/False question.
</p>
</introduction>
<exercise label="vector-space-dimension">
<title>True/False</title>
<idx>vector space</idx>
<statement correct="no">
<p>
Every vector space has finite dimension.
</p>
</statement>
<feedback>
<p>
The vector space of all polynomials with finite degree has a basis,
<m>B = \{1,x,x^2,x^3,\dots\}</m>, which is infinte.
</p>
</feedback>
<hint>
<p>
<m>P_n</m>, the vector space of polynomials with degree at most <m>n</m>,
has dimension <m>n+1</m> by <xref ref="theorem-FTC" />. [Cross-reference is just a demo,
content is not relevant.] What happens if we relax the defintion and remove the parameter <m>n</m>?
</p>
</hint>
</exercise>
</exercises>
<exercises>
<title>Multiple-Choice</title>
<introduction>
<p>
Multiple-Choice problem
</p>
</introduction>
<exercise label="multiple-choice-not-randomized">
<title>Multiple-Choice, Not Randomized, One Answer</title>
<idx>stop signs</idx>
<statement>
<p>
What color is a stop sign?
</p>
</statement>
<choices>
<choice>
<statement>
<p>
Green
</p>
</statement>
<feedback>
<p>
Green means
<q>go!</q>.
</p>
</feedback>
</choice>
<choice correct="yes">
<statement>
<p>
Red
</p>
</statement>
<feedback>
<p>
Red is universally used for prohibited activities or serious warnings.
</p>
</feedback>
</choice>
<choice>
<statement>
<p>
White
</p>
</statement>
<feedback>
<p>
White might be hard to see.
</p>
</feedback>
</choice>
</choices>
<hint>
<p>
What did you see last time you went driving?
</p>
</hint>
<hint>
<p>
Maybe go out for a drive?
</p>
</hint>
</exercise>
</exercises>
<exercises>
<title>Parsons Problem, Math Proof</title>
<introduction>
<p>
With some MathJax.
</p>
</introduction>
<exercise label="number-theory-proof" adaptive="yes">
<title>Parsons Problem, Mathematical Proof</title>
<idx>even numbers</idx>
<statement>
<p>
Create a proof of the theorem: If <m>n</m> is an even number,
then <m>n\equiv 0\mod 2</m>.
</p>
</statement>
<blocks>
<block order="2">
<p>
Suppose <m>n</m> is even.
</p>
</block>
<block order="3">
<choice>
<p>
Then <m>n</m> is a prime number.
</p>
</choice>
<choice correct="yes">
<p>
Then there exists an <m>m</m> so that <m>n = 2m</m>.
</p>
</choice>
<choice>
<p>
Then there exists an <m>m</m> so that <m>n = 2m + 1</m>.
</p>
</choice>
</block>
<block order="1" correct="no">
<p>
Click the heels of your ruby slippers together three times.
</p>
</block>
<block order="5">
<p>
So we have the displayed equation:
<me>
n = 2m + 0
</me>.
</p>
<p>
This is a superfluous second paragraph in this block.
</p>
</block>
<block order="4">
<p>
Thus <m>n\equiv 0\mod 2</m>.
</p>
</block>
</blocks>
<hint>
<p>
Dorothy will not be much help with this proof.
</p>
</hint>
</exercise>
</exercises>
<exercises>
<title>Parsons Problem, Code</title>
<introduction>
<p>
Programming Parsons problem, requiring indentation.
</p>
</introduction>
<exercise label="prime-number-program-indent-yes" language="python" adaptive="yes" indentation="hide">
<title>Parsons Problem, Programming</title>
<idx>prime numbers</idx>
<idx>Sieve of Eratosthenes</idx>
<statement>
<p>
The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1.
The first member of the list is a prime and is saved/recorded.
Then all multiples of that prime
(which not a prime, excepting the prime itself!)
are removed from the list.
Now the first number remaining in the list is the next prime number.
And the process repeats.
</p>
<p>
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than <m>250</m>. [Ed. this version of this problem requires the reader to provide the necessary indentation.]
</p>
</statement>
<blocks>
<block order="6">
<cline>n = 250</cline>
</block>
<block order="2">
<choice correct="yes">
<cline>primes = []</cline>
<cline>candidates = list(range(2,n))</cline>
</choice>
<choice>
<cline>candidates = []</cline>
<cline>primes = list(range(2,n))</cline>
</choice>
</block>
<block order="7" correct="no">
<cline>primes = candidates + [p]</cline>
</block>
<block order="8">
<cline>while candidates:</cline>
</block>
<block order="3">
<cline>p = candidates[0]</cline>
<cline>primes.append(p)</cline>
</block>
<block order="1">
<cline>for nonprime in range(p, n, p):</cline>
</block>
<block order="5">
<cline>if nonprime in candidates:</cline>
<cline>candidates.remove(nonprime)</cline>
</block>
<block order="4">
<cline>print(primes)</cline>
</block>
</blocks>
</exercise>
</exercises>
<exercises>
<title>Matching</title>
<introduction>
<p>
Events and dates.
</p>
</introduction>
<exercise label="matching-dates">
<title>Matching Problem, Dates</title>
<idx>matching US dates</idx>
<statement>
<p>
Match each event in United States history with the year it happened.
</p>
</statement>
<feedback>
<p>
Review
<url href="https://www.britannica.com/list/25-decade-defining-events-in-us-history" visual="www.britannica.com/list/25-decade-defining-events-in-us-history">Encyclopedia Brittania, 25 Decade-Defining Events in U.S. History</url>
url.
</p>
</feedback>
<matches>
<match order="4">
<premise>Monroe Doctrine</premise>
<response>1823</response>
</match>
<match order="3">
<premise>Haymarket Riot</premise>
<response>1886</response>
</match>
<match order="1">
<premise>Louisiana Purchase</premise>
<response>1803</response>
</match>
<match order="2">
<premise>Battle of Gettysburg</premise>
<response>1863</response>
</match>
</matches>
</exercise>
</exercises>
<exercises>
<title>Clickable Area</title>
<introduction>
<p>
Words, not code.
</p>
</introduction>
<exercise label="clickable-text">
<title>Clickable Areas,
<q>Regular</q>
Text</title>
<statement>
<p>
Identify (by clicking,
or by circling) all of the nouns in this quotation by Eleanor Roosevelt.
</p>
</statement>
<areas>
<p>
<q>The <area>future</area> belongs to <area correct="no">those</area> who believe in the <area correct="yes">beauty</area> of <area correct="no">their</area> <area>dreams</area>.</q>
</p>
</areas>
<feedback>
<p>
The incorrect words are pronouns.
</p>
</feedback>
</exercise>
</exercises>
<exercises>
<title>Old-Style Fillin-In</title>
<introduction>
<p>
Do not use this as a model for new exercises.
Just for backwards-compatibility.
</p>
</introduction>
<exercise label="fillin-string-integer">
<title>Fill-In, String and Number Answers</title>
<statement>
<p>
Complete the following line of a Python program so that it will declare an integer variable <c>age</c> with an initial value of <c>5</c>.
</p>
<p>
<var /> <c>age = </c> <var /><c>;</c>
</p>
</statement>
<setup>
<var>
<condition string="int">
<feedback>
<p>
A variable of type <c>int</c> is appropriate for whole number ages.
</p>
</feedback>
</condition>
<condition string=".*">
<feedback>
<p>
Remember that Java uses just the first three letters of the word
<q>integer</q>
to define an integral type.
</p>
</feedback>
</condition>
</var>
<var>
<condition number="5">
<feedback>
<p>
An integer variable may be initialized to a value.
</p>
</feedback>
</condition>
<condition string=".*">
<feedback>
<p>
Use <c>5</c> as the initial value of the variable.
</p>
</feedback>
</condition>
</var>
</setup>
</exercise>
</exercises>
<reading-questions>
<title>A Reading Question</title>
<exercise label="short-answer-question">
<title>Short Answer</title>
<statement>
<p>
This should be built with a text-box,
<em>only</em> on a capable server (Runestone).
So it can be answered
</p>
</statement>
<response />
</exercise>
</reading-questions>
<subsection>
<title>Faux Subsection</title>
<p>
We used <tag>exercises</tag> divisions above,
and need a <tag>subsection</tag> to feed the schema.
</p>
</subsection>
</section>
Section 15 Interactive Exercises
View Source for section
Interactive components, just for testing, no commentary.
Exercises 15.1 True/False
View Source for exercises
<exercises>
<title>True/False</title>
<introduction>
<p>
A True/False question.
</p>
</introduction>
<exercise label="vector-space-dimension">
<title>True/False</title>
<idx>vector space</idx>
<statement correct="no">
<p>
Every vector space has finite dimension.
</p>
</statement>
<feedback>
<p>
The vector space of all polynomials with finite degree has a basis,
<m>B = \{1,x,x^2,x^3,\dots\}</m>, which is infinte.
</p>
</feedback>
<hint>
<p>
<m>P_n</m>, the vector space of polynomials with degree at most <m>n</m>,
has dimension <m>n+1</m> by <xref ref="theorem-FTC" />. [Cross-reference is just a demo,
content is not relevant.] What happens if we relax the defintion and remove the parameter <m>n</m>?
</p>
</hint>
</exercise>
</exercises>
A True/False question.
1. True/False.
View Source for exercise
<exercise label="vector-space-dimension">
<title>True/False</title>
<idx>vector space</idx>
<statement correct="no">
<p>
Every vector space has finite dimension.
</p>
</statement>
<feedback>
<p>
The vector space of all polynomials with finite degree has a basis,
<m>B = \{1,x,x^2,x^3,\dots\}</m>, which is infinte.
</p>
</feedback>
<hint>
<p>
<m>P_n</m>, the vector space of polynomials with degree at most <m>n</m>,
has dimension <m>n+1</m> by <xref ref="theorem-FTC" />. [Cross-reference is just a demo,
content is not relevant.] What happens if we relax the defintion and remove the parameter <m>n</m>?
</p>
</hint>
</exercise>
True.
- The vector space of all polynomials with finite degree has a basis, \(B = \{1,x,x^2,x^3,\dots\}\text{,}\) which is infinte.
False.
- The vector space of all polynomials with finite degree has a basis, \(B = \{1,x,x^2,x^3,\dots\}\text{,}\) which is infinte.
Every vector space has finite dimension.
Hint.
View Source for hint
<hint>
<p>
<m>P_n</m>, the vector space of polynomials with degree at most <m>n</m>,
has dimension <m>n+1</m> by <xref ref="theorem-FTC" />. [Cross-reference is just a demo,
content is not relevant.] What happens if we relax the defintion and remove the parameter <m>n</m>?
</p>
</hint>
\(P_n\text{,}\) the vector space of polynomials with degree at most \(n\text{,}\) has dimension \(n+1\) by 2.1. [Cross-reference is just a demo, content is not relevant.] What happens if we relax the defintion and remove the parameter \(n\text{?}\)
Exercises 15.2 Multiple-Choice
View Source for exercises
<exercises>
<title>Multiple-Choice</title>
<introduction>
<p>
Multiple-Choice problem
</p>
</introduction>
<exercise label="multiple-choice-not-randomized">
<title>Multiple-Choice, Not Randomized, One Answer</title>
<idx>stop signs</idx>
<statement>
<p>
What color is a stop sign?
</p>
</statement>
<choices>
<choice>
<statement>
<p>
Green
</p>
</statement>
<feedback>
<p>
Green means
<q>go!</q>.
</p>
</feedback>
</choice>
<choice correct="yes">
<statement>
<p>
Red
</p>
</statement>
<feedback>
<p>
Red is universally used for prohibited activities or serious warnings.
</p>
</feedback>
</choice>
<choice>
<statement>
<p>
White
</p>
</statement>
<feedback>
<p>
White might be hard to see.
</p>
</feedback>
</choice>
</choices>
<hint>
<p>
What did you see last time you went driving?
</p>
</hint>
<hint>
<p>
Maybe go out for a drive?
</p>
</hint>
</exercise>
</exercises>
Multiple-Choice problem
1. Multiple-Choice, Not Randomized, One Answer.
View Source for exercise
<exercise label="multiple-choice-not-randomized">
<title>Multiple-Choice, Not Randomized, One Answer</title>
<idx>stop signs</idx>
<statement>
<p>
What color is a stop sign?
</p>
</statement>
<choices>
<choice>
<statement>
<p>
Green
</p>
</statement>
<feedback>
<p>
Green means
<q>go!</q>.
</p>
</feedback>
</choice>
<choice correct="yes">
<statement>
<p>
Red
</p>
</statement>
<feedback>
<p>
Red is universally used for prohibited activities or serious warnings.
</p>
</feedback>
</choice>
<choice>
<statement>
<p>
White
</p>
</statement>
<feedback>
<p>
White might be hard to see.
</p>
</feedback>
</choice>
</choices>
<hint>
<p>
What did you see last time you went driving?
</p>
</hint>
<hint>
<p>
Maybe go out for a drive?
</p>
</hint>
</exercise>
- Green
- Green means “go!”.
- Red
- Red is universally used for prohibited activities or serious warnings.
- White
- White might be hard to see.
What color is a stop sign?
Hint 1.
View Source for hint
<hint>
<p>
What did you see last time you went driving?
</p>
</hint>
What did you see last time you went driving?
Hint 2.
View Source for hint
<hint>
<p>
Maybe go out for a drive?
</p>
</hint>
Maybe go out for a drive?
Exercises 15.3 Parsons Problem, Math Proof
View Source for exercises
<exercises>
<title>Parsons Problem, Math Proof</title>
<introduction>
<p>
With some MathJax.
</p>
</introduction>
<exercise label="number-theory-proof" adaptive="yes">
<title>Parsons Problem, Mathematical Proof</title>
<idx>even numbers</idx>
<statement>
<p>
Create a proof of the theorem: If <m>n</m> is an even number,
then <m>n\equiv 0\mod 2</m>.
</p>
</statement>
<blocks>
<block order="2">
<p>
Suppose <m>n</m> is even.
</p>
</block>
<block order="3">
<choice>
<p>
Then <m>n</m> is a prime number.
</p>
</choice>
<choice correct="yes">
<p>
Then there exists an <m>m</m> so that <m>n = 2m</m>.
</p>
</choice>
<choice>
<p>
Then there exists an <m>m</m> so that <m>n = 2m + 1</m>.
</p>
</choice>
</block>
<block order="1" correct="no">
<p>
Click the heels of your ruby slippers together three times.
</p>
</block>
<block order="5">
<p>
So we have the displayed equation:
<me>
n = 2m + 0
</me>.
</p>
<p>
This is a superfluous second paragraph in this block.
</p>
</block>
<block order="4">
<p>
Thus <m>n\equiv 0\mod 2</m>.
</p>
</block>
</blocks>
<hint>
<p>
Dorothy will not be much help with this proof.
</p>
</hint>
</exercise>
</exercises>
With some MathJax.
1. Parsons Problem, Mathematical Proof.
View Source for exercise
<exercise label="number-theory-proof" adaptive="yes">
<title>Parsons Problem, Mathematical Proof</title>
<idx>even numbers</idx>
<statement>
<p>
Create a proof of the theorem: If <m>n</m> is an even number,
then <m>n\equiv 0\mod 2</m>.
</p>
</statement>
<blocks>
<block order="2">
<p>
Suppose <m>n</m> is even.
</p>
</block>
<block order="3">
<choice>
<p>
Then <m>n</m> is a prime number.
</p>
</choice>
<choice correct="yes">
<p>
Then there exists an <m>m</m> so that <m>n = 2m</m>.
</p>
</choice>
<choice>
<p>
Then there exists an <m>m</m> so that <m>n = 2m + 1</m>.
</p>
</choice>
</block>
<block order="1" correct="no">
<p>
Click the heels of your ruby slippers together three times.
</p>
</block>
<block order="5">
<p>
So we have the displayed equation:
<me>
n = 2m + 0
</me>.
</p>
<p>
This is a superfluous second paragraph in this block.
</p>
</block>
<block order="4">
<p>
Thus <m>n\equiv 0\mod 2</m>.
</p>
</block>
</blocks>
<hint>
<p>
Dorothy will not be much help with this proof.
</p>
</hint>
</exercise>
Create a proof of the theorem: If \(n\) is an even number, then \(n\equiv 0\mod 2\text{.}\)
Hint.
View Source for hint
<hint>
<p>
Dorothy will not be much help with this proof.
</p>
</hint>
Dorothy will not be much help with this proof.
Exercises 15.4 Parsons Problem, Code
View Source for exercises
<exercises>
<title>Parsons Problem, Code</title>
<introduction>
<p>
Programming Parsons problem, requiring indentation.
</p>
</introduction>
<exercise label="prime-number-program-indent-yes" language="python" adaptive="yes" indentation="hide">
<title>Parsons Problem, Programming</title>
<idx>prime numbers</idx>
<idx>Sieve of Eratosthenes</idx>
<statement>
<p>
The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1.
The first member of the list is a prime and is saved/recorded.
Then all multiples of that prime
(which not a prime, excepting the prime itself!)
are removed from the list.
Now the first number remaining in the list is the next prime number.
And the process repeats.
</p>
<p>
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than <m>250</m>. [Ed. this version of this problem requires the reader to provide the necessary indentation.]
</p>
</statement>
<blocks>
<block order="6">
<cline>n = 250</cline>
</block>
<block order="2">
<choice correct="yes">
<cline>primes = []</cline>
<cline>candidates = list(range(2,n))</cline>
</choice>
<choice>
<cline>candidates = []</cline>
<cline>primes = list(range(2,n))</cline>
</choice>
</block>
<block order="7" correct="no">
<cline>primes = candidates + [p]</cline>
</block>
<block order="8">
<cline>while candidates:</cline>
</block>
<block order="3">
<cline>p = candidates[0]</cline>
<cline>primes.append(p)</cline>
</block>
<block order="1">
<cline>for nonprime in range(p, n, p):</cline>
</block>
<block order="5">
<cline>if nonprime in candidates:</cline>
<cline>candidates.remove(nonprime)</cline>
</block>
<block order="4">
<cline>print(primes)</cline>
</block>
</blocks>
</exercise>
</exercises>
Programming Parsons problem, requiring indentation.
1. Parsons Problem, Programming.
View Source for exercise
<exercise label="prime-number-program-indent-yes" language="python" adaptive="yes" indentation="hide">
<title>Parsons Problem, Programming</title>
<idx>prime numbers</idx>
<idx>Sieve of Eratosthenes</idx>
<statement>
<p>
The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1.
The first member of the list is a prime and is saved/recorded.
Then all multiples of that prime
(which not a prime, excepting the prime itself!)
are removed from the list.
Now the first number remaining in the list is the next prime number.
And the process repeats.
</p>
<p>
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than <m>250</m>. [Ed. this version of this problem requires the reader to provide the necessary indentation.]
</p>
</statement>
<blocks>
<block order="6">
<cline>n = 250</cline>
</block>
<block order="2">
<choice correct="yes">
<cline>primes = []</cline>
<cline>candidates = list(range(2,n))</cline>
</choice>
<choice>
<cline>candidates = []</cline>
<cline>primes = list(range(2,n))</cline>
</choice>
</block>
<block order="7" correct="no">
<cline>primes = candidates + [p]</cline>
</block>
<block order="8">
<cline>while candidates:</cline>
</block>
<block order="3">
<cline>p = candidates[0]</cline>
<cline>primes.append(p)</cline>
</block>
<block order="1">
<cline>for nonprime in range(p, n, p):</cline>
</block>
<block order="5">
<cline>if nonprime in candidates:</cline>
<cline>candidates.remove(nonprime)</cline>
</block>
<block order="4">
<cline>print(primes)</cline>
</block>
</blocks>
</exercise>
The Sieve of Eratosthenes computes prime numbers by starting with a finite list of the integers bigger than 1. The first member of the list is a prime and is saved/recorded. Then all multiples of that prime (which not a prime, excepting the prime itself!) are removed from the list. Now the first number remaining in the list is the next prime number. And the process repeats.
The code blocks below can be rearranged to form one of the many possible programs to implement this algorithm to compute a list of all the primes less than \(250\text{.}\) [Ed. this version of this problem requires the reader to provide the necessary indentation.]
Exercises 15.5 Matching
View Source for exercises
<exercises>
<title>Matching</title>
<introduction>
<p>
Events and dates.
</p>
</introduction>
<exercise label="matching-dates">
<title>Matching Problem, Dates</title>
<idx>matching US dates</idx>
<statement>
<p>
Match each event in United States history with the year it happened.
</p>
</statement>
<feedback>
<p>
Review
<url href="https://www.britannica.com/list/25-decade-defining-events-in-us-history" visual="www.britannica.com/list/25-decade-defining-events-in-us-history">Encyclopedia Brittania, 25 Decade-Defining Events in U.S. History</url>
url.
</p>
</feedback>
<matches>
<match order="4">
<premise>Monroe Doctrine</premise>
<response>1823</response>
</match>
<match order="3">
<premise>Haymarket Riot</premise>
<response>1886</response>
</match>
<match order="1">
<premise>Louisiana Purchase</premise>
<response>1803</response>
</match>
<match order="2">
<premise>Battle of Gettysburg</premise>
<response>1863</response>
</match>
</matches>
</exercise>
</exercises>
Events and dates.
1. Matching Problem, Dates.
View Source for exercise
<exercise label="matching-dates">
<title>Matching Problem, Dates</title>
<idx>matching US dates</idx>
<statement>
<p>
Match each event in United States history with the year it happened.
</p>
</statement>
<feedback>
<p>
Review
<url href="https://www.britannica.com/list/25-decade-defining-events-in-us-history" visual="www.britannica.com/list/25-decade-defining-events-in-us-history">Encyclopedia Brittania, 25 Decade-Defining Events in U.S. History</url>
url.
</p>
</feedback>
<matches>
<match order="4">
<premise>Monroe Doctrine</premise>
<response>1823</response>
</match>
<match order="3">
<premise>Haymarket Riot</premise>
<response>1886</response>
</match>
<match order="1">
<premise>Louisiana Purchase</premise>
<response>1803</response>
</match>
<match order="2">
<premise>Battle of Gettysburg</premise>
<response>1863</response>
</match>
</matches>
</exercise>
Exercises 15.6 Clickable Area
View Source for exercises
<exercises>
<title>Clickable Area</title>
<introduction>
<p>
Words, not code.
</p>
</introduction>
<exercise label="clickable-text">
<title>Clickable Areas,
<q>Regular</q>
Text</title>
<statement>
<p>
Identify (by clicking,
or by circling) all of the nouns in this quotation by Eleanor Roosevelt.
</p>
</statement>
<areas>
<p>
<q>The <area>future</area> belongs to <area correct="no">those</area> who believe in the <area correct="yes">beauty</area> of <area correct="no">their</area> <area>dreams</area>.</q>
</p>
</areas>
<feedback>
<p>
The incorrect words are pronouns.
</p>
</feedback>
</exercise>
</exercises>
Words, not code.
1. Clickable Areas, “Regular” Text.
View Source for exercise
<exercise label="clickable-text">
<title>Clickable Areas,
<q>Regular</q>
Text</title>
<statement>
<p>
Identify (by clicking,
or by circling) all of the nouns in this quotation by Eleanor Roosevelt.
</p>
</statement>
<areas>
<p>
<q>The <area>future</area> belongs to <area correct="no">those</area> who believe in the <area correct="yes">beauty</area> of <area correct="no">their</area> <area>dreams</area>.</q>
</p>
</areas>
<feedback>
<p>
The incorrect words are pronouns.
</p>
</feedback>
</exercise>
Exercises 15.7 Old-Style Fillin-In
View Source for exercises
<exercises>
<title>Old-Style Fillin-In</title>
<introduction>
<p>
Do not use this as a model for new exercises.
Just for backwards-compatibility.
</p>
</introduction>
<exercise label="fillin-string-integer">
<title>Fill-In, String and Number Answers</title>
<statement>
<p>
Complete the following line of a Python program so that it will declare an integer variable <c>age</c> with an initial value of <c>5</c>.
</p>
<p>
<var /> <c>age = </c> <var /><c>;</c>
</p>
</statement>
<setup>
<var>
<condition string="int">
<feedback>
<p>
A variable of type <c>int</c> is appropriate for whole number ages.
</p>
</feedback>
</condition>
<condition string=".*">
<feedback>
<p>
Remember that Java uses just the first three letters of the word
<q>integer</q>
to define an integral type.
</p>
</feedback>
</condition>
</var>
<var>
<condition number="5">
<feedback>
<p>
An integer variable may be initialized to a value.
</p>
</feedback>
</condition>
<condition string=".*">
<feedback>
<p>
Use <c>5</c> as the initial value of the variable.
</p>
</feedback>
</condition>
</var>
</setup>
</exercise>
</exercises>
Do not use this as a model for new exercises. Just for backwards-compatibility.
1. Fill-In, String and Number Answers.
View Source for exercise
<exercise label="fillin-string-integer">
<title>Fill-In, String and Number Answers</title>
<statement>
<p>
Complete the following line of a Python program so that it will declare an integer variable <c>age</c> with an initial value of <c>5</c>.
</p>
<p>
<var /> <c>age = </c> <var /><c>;</c>
</p>
</statement>
<setup>
<var>
<condition string="int">
<feedback>
<p>
A variable of type <c>int</c> is appropriate for whole number ages.
</p>
</feedback>
</condition>
<condition string=".*">
<feedback>
<p>
Remember that Java uses just the first three letters of the word
<q>integer</q>
to define an integral type.
</p>
</feedback>
</condition>
</var>
<var>
<condition number="5">
<feedback>
<p>
An integer variable may be initialized to a value.
</p>
</feedback>
</condition>
<condition string=".*">
<feedback>
<p>
Use <c>5</c> as the initial value of the variable.
</p>
</feedback>
</condition>
</var>
</setup>
</exercise>
Complete the following line of a Python program so that it will declare an integer variable
age
with an initial value of 5
.age =
;
Reading Questions 15.8 A Reading Question
View Source for reading-questions
<reading-questions>
<title>A Reading Question</title>
<exercise label="short-answer-question">
<title>Short Answer</title>
<statement>
<p>
This should be built with a text-box,
<em>only</em> on a capable server (Runestone).
So it can be answered
</p>
</statement>
<response />
</exercise>
</reading-questions>
1. Short Answer.
View Source for exercise
<exercise label="short-answer-question">
<title>Short Answer</title>
<statement>
<p>
This should be built with a text-box,
<em>only</em> on a capable server (Runestone).
So it can be answered
</p>
</statement>
<response />
</exercise>
This should be built with a text-box, only on a capable server (Runestone). So it can be answered
Subsection 15.9 Faux Subsection
View Source for subsection
<subsection>
<title>Faux Subsection</title>
<p>
We used <tag>exercises</tag> divisions above,
and need a <tag>subsection</tag> to feed the schema.
</p>
</subsection>
We used
<exercises>
divisions above, and need a <subsection>
to feed the schema.