forked from Khan/khan-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
changing_fractions_to_percents.html
59 lines (49 loc) · 2.3 KB
/
changing_fractions_to_percents.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html data-require="math math-format graphie graphie-helpers">
<head>
<title>Changing fractions to percents</title>
<script src="../khan-exercise.js"></script>
<script type="text/javascript">
function decimalLength( n ) {
return ( ( n + "" ).split( "." )[1] || "" ).length;
}
</script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div>
<div class="vars">
<div data-ensure="decimalLength( DEC ) <= 4">
<var id="_D">randFromArray([ 4, 5, 8, 10, 16, 20, 25, 40, 50, 100 ])</var>
<var id="_N">randRange( 1, _D - 1 )</var>
<var id="DEC">_N / _D</var>
</div>
<var id="GCD">getGCD( _N, _D )</var>
<var id="N">round( _N / GCD )</var>
<var id="D">round( _D / GCD )</var>
</div>
<p class="question">Express <code><var>fraction( _N, _D )</var></code> as a percent.</p>
<div class="solution" data-type="multiple">
<span class="sol" data-type="decimal"><var>100 * DEC</var></span> %
</div>
<div class="hints">
<div data-if="_D === 100" data-unwrap>
<p>When the denominator is 100, you can simply take the numerator and apply the % sign:</p>
<p><code><var>fraction( _N, _D )</var></code> = <var>100 * DEC</var>%</p>
</div>
<div data-else data-unwrap>
<p data-if="GCD > 1"><code><var>fraction( _N, _D )</var></code> reduces to <code><var>fraction( N, D )</var></code>.</p>
<p>To turn a fraction into a percent, turn the fraction into a decimal and then multiply the decimal by 100.</p>
<p data-if="D === 10">Denominators of 10 are an easy case: The decimal form is just the numerator with the decimal place moved left by the number of 0s in the denominator - in this case 1 place.</p>
<p data-else>To turn <code><var>fraction( N, D )</var></code> into a decimal, perform long division, dividing <code><var>D</var></code> into <code><var>N</var></code> (if you need help with this, try practicing some Division exercises or watching some related videos).</p>
<p><code><var>N</var> \div <var>D</var> = <var>DEC</var></code></p>
<p>To convert this decimal into a percent, we need to multiply it by 100.</p>
<p><code><var>DEC</var> = (100 \cdot <var>DEC</var>) \% = <var>roundTo( 2, 100 * DEC )</var>\%</code></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>