Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (33 sloc) 1.508 kb
<!DOCTYPE html>
<html data-require="math word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Composite numbers</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="COMPOSITE">rand( 5 ) === 0 ? getEvenComposite() : getOddComposite()</var>
<var id="PRIMES">shuffle( primes, 4 )</var>
<var id="CHOICES">shuffle( PRIMES.concat([ COMPOSITE ]) )</var>
</div>
<div class="problems">
<div>
<p class="question">Which of these numbers is composite?</p>
<p><code>\large{<var>CHOICES.join( ",\\ " )</var>}</code></p>
<p class="solution"><code><var>COMPOSITE</var></code></p>
<ul class="choices" data-category="true">
<li data-each="CHOICES as CHOICE"><code><var>CHOICE</var></code></li>
</ul>
</div>
</div>
<div class="hints">
<p>A composite number is a number that has more than two factors (including 1 and itself).</p>
<p><var>toSentence( _.filter( CHOICES, function( p ) { return p !== COMPOSITE; } ) )</var> each have only two factors.</p>
<p>The factors of <var>COMPOSITE</var> are <var>toSentence( getFactors( COMPOSITE ) )</var>.</p>
<p>Thus, <var>COMPOSITE</var> is the composite number.</p>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.