forked from Khan/khan-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
converting_decimals_to_fractions_1.html
54 lines (52 loc) · 2.53 KB
/
converting_decimals_to_fractions_1.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
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<title>Converting decimals to fractions 1</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="to-the-tenth">
<div class="vars">
<var id="D">randRange( 1, 9 ) / 10</var>
<var id="T">floor( D * 10 )</var>
</div>
<p class="question">Express <code><var>D.toFixed( 1 )</var></code> as a fraction.</p>
<p class="solution" data-type="rational" data-simplify="optional"><var>D</var></p>
<div class="hints">
<p>The number <code><var>T</var></code> is in the tenths place, so we have <var>cardinal( T )</var> tenth<span data-if="T !== 1">s</span>.</p>
<p><var>Cardinal( T )</var> tenth<span data-if="T !== 1">s</span> can be written as <code><var>fraction( T, 10 )</var></code>.</p>
</div>
</div>
<div id="to-the-hundredth" data-type="to-the-tenth" data-weight="3">
<div class="vars">
<var id="D">randRangeExclude(1, 99, [10,20,30,40,50,60,70,80,90]) / 100</var>
<var id="T">floor( D * 10 )</var>
<var id="H">floor( ( D * 100 ) % 10 )</var>
</div>
<p class="question">Express <code><var>D.toFixed( 2 )</var></code> as a fraction.</p>
<p class="solution" data-type="rational" data-simplify="optional"><var>D</var></p>
<div class="hints">
<p>The number <code><var>T</var></code> is in the tenths place, so we have <var>cardinal( T )</var> tenth<span data-if="T !== 1">s</span>.</p>
<p><var>Cardinal( T )</var> tenth<span data-if="T !== 1">s</span> can be written as <code><var>fraction( T, 10 )</var></code>.</p>
<p>The number <code><var>H</var></code> is in the hundredths place, so we have <var>cardinal( H )</var> hundredth<span data-if="H !== 1">s</span>.</p>
<p><var>Cardinal( H )</var> hundredth<span data-if="H !== 1">s</span> can be written as <code><var>fraction( H, 100 )</var></code>.</p>
<div>
<p>Add the two parts together.</p>
<p><code><var>fraction( T, 10 )</var> + <var>fraction( H, 100 )</var></code></p>
</div>
<div>
<p><code>= <var>fraction( T * 10, 100 )</var> + <var>fraction( H, 100 )</var></code></p>
<p><code>= <var>fraction( T * 10 + H, 100 )</var></code></p>
</div>
<div>
<p>You can also skip a few steps by making a fraction with <code><var>floor( D * 100 )</var></code> as the numerator and <code>100</code> (because the decimal extends to the hundredths place) as the denominator.</p>
<p><code><var>fraction( T * 10 + H, 100 )</var></code></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>