Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 196 lines (162 sloc) 9.067 kb
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
1 <!DOCTYPE html>
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
2 <html data-require="math math-format">
cde9e9f John Resig Re-run the exercises through the updated cleaner.
jeresig authored
3 <head>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
5 <title>Order of operations</title>
ac1415e Ben Alpert Use requirejs for module loading
spicyj authored
6 <script data-main="../local-only/main.js" src="../local-only/require.js"></script>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
7 </head>
8 <body>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
9 <div class="exercise">
ed4bc07 Peter Collingridge Fix data ensure
petercollingridge authored
10 <div class="vars" data-ensure="B + C !== 0 && (A < 0 || B < 0 || C < 0)">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
11 <var id="A">randRangeNonZero(-10, 10)</var>
12 <var id="B">randRangeNonZero(-10, 10)</var>
13 <var id="C">randRangeNonZero(-10, 10)</var>
14 <var id="D">randRangeNonZero(-5, 5)</var>
15 <var id="E">randRangeNonZero(-5, 5)</var>
16 <var id="USE_PAREN">rand(2)</var>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
17 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
18
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
19 <div class="problems">
20 <div id="order-of-operations">
c908496 Peter Collingridge Remove parentheses
petercollingridge authored
21 <p class="question">Evaluate the following expression.</p>
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
22 <p class="problem">
23 <span data-if="USE_PAREN"><code><var>A</var> + (<var>B</var> \times <var>C</var>)</code></span>
24 <span data-else=""><code><var>A</var> + <var>B</var> \times <var>C</var></code></span>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
25 </p>
cf02179 Ben Alpert Strip trailing whitespace
spicyj authored
26
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
27 <p class="solution" data-forms="integer"><var>A + B * C</var></p>
cf02179 Ben Alpert Strip trailing whitespace
spicyj authored
28
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
29 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
30 <p data-if="USE_PAREN"><code>= <var>A</var> + (<var>B * C</var>)</code></p>
31 <p><code>= <var>A</var> + <var>B * C</var></code></p>
32 <p><code>= <var>A + B * C</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
33 </div>
34 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
35
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
36 <div data-type="order-of-operations">
37 <p class="problem">
38 <code><var>A</var> \times (<var>B</var> + <var>C</var>)</code>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
39 </p>
cf02179 Ben Alpert Strip trailing whitespace
spicyj authored
40
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
41 <p class="solution" data-forms="integer"><var>A * (B + C)</var></p>
42
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
43 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
44 <p><code>= <var>A</var> \times <var>B + C</var></code></p>
45 <p><code>= <var>A * (B + C)</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
46 </div>
47 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
48
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
49 <div data-type="order-of-operations">
50 <p class="problem">
51 <span data-if="USE_PAREN"><code><var>A</var> + \left(\dfrac{<var>B * C</var>}{<var>C</var>}\right)</code></span>
52 <span data-else=""><code><var>A</var> + \dfrac{<var>B * C</var>}{<var>C</var>}</code></span>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
53 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
54
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
55 <p class="solution" data-forms="integer"><var>A + B</var></p>
56
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
57 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
58 <p data-if="USE_PAREN"><code>= <var>A</var> + (<var>B</var>)</code></p>
59 <p><code>= <var>A</var> + <var>B</var></code></p>
60 <p><code>= <var>A + B</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
61 </div>
62 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
63
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
64 <div data-type="order-of-operations">
65 <p class="problem">
66 <code>\dfrac{<var>A * (B + C)</var>}{<var>B</var> + <var>C</var>}</code>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
67 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
68
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
69 <p class="solution" data-forms="integer"><var>A</var></p>
70
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
71 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
72 <p><code>= \dfrac{<var>A * (B + C)</var>}{<var>B + C</var> }</code></p>
73 <p><code>= <var>A</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
74 </div>
75 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
76
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
77 <div data-type="order-of-operations">
78 <p class="problem">
79 <code>(<var>A</var> + (<var>B</var> - <var>C</var> \times <var>D</var>)) \times <var>E</var></code>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
80 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
81
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
82 <p class="solution" data-forms="integer"><var>(A + (B - (C * D))) * E</var></p>
83
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
84 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
85 <p><code>= (<var>A</var> + (<var>B</var> - <var>C * D</var>)) \times <var>E</var></code></p>
86 <p><code>= (<var>A</var> + (<var>B - (C * D)</var>)) \times <var>E</var></code></p>
87 <p><code>= (<var>A</var> + <var>B - (C * D)</var>) \times <var>E</var></code></p>
88 <p><code>= (<var>A + (B - (C * D))</var>) \times <var>E</var></code></p>
89 <p><code>= <var>A + (B - (C * D))</var> \times <var>E</var></code></p>
90 <p><code>= <var>(A + (B - (C * D))) * E</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
91 </div>
92 </div>
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
93
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
94 <div data-type="order-of-operations">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
95 <p class="problem">
96 <code><var>A</var> + (<var>B</var> + <var>C</var> \times <var>D</var>) \times <var>E</var></code></p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
97
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
98 <p class="solution" data-forms="integer"><var>A + ((B + (C * D)) * E)</var></p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
99
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
100 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
101 <p><code>= <var>A</var> + (<var>B</var> + <var>C * D</var>) \times <var>E</var></code></p>
102 <p><code>= <var>A</var> + (<var>B + C * D</var>) \times <var>E</var></code></p>
103 <p><code>= <var>A</var> + <var>(B + C * D) * E</var></code></p>
104 <p><code>= <var>A + (B + C * D) * E</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
105 </div>
106 </div>
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
107
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
108 <div data-type="order-of-operations">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
109 <p class="problem">
110 <code><var>A</var> + <var>B</var> \times <var>C</var> + \dfrac{<var>(D * E)</var>}{<var>E</var>}</code>
111 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
112
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
113 <p class="solution" data-forms="integer">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
114 <var>A + B * C + D</var>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
115 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
116
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
117 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
118 <p><code>= <var>A</var> + <var>B</var> \times <var>C</var> + <var>D</var></code></p>
119 <p><code>= <var>A</var> + <var>B * C</var> + <var>D</var></code></p>
120 <p><code>= <var>A + B * C</var> + <var>D</var></code></p>
121 <p><code>= <var>A + B * C + D</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
122 </div>
123 </div>
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
124
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
125 <div data-type="order-of-operations">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
126 <p class="problem">
127 <code><var>A</var> \times <var>B</var> + <var>C</var> \times \dfrac{<var>(D * E)</var>}{<var>E</var>}</code>
128 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
129
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
130 <p class="solution" data-forms="integer">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
131 <var>(A * B) + (C * D)</var>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
132 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
133
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
134 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
135 <p><code>= <var>A</var> \times <var>B</var> + <var>C</var> \times <var>D</var></code></p>
136 <p><code>= <var>A * B</var> + <var>C</var> \times <var>D</var></code></p>
137 <p><code>= <var>A * B</var> + <var>C * D</var></code></p>
138 <p><code>= <var>A * B + C * D</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
139 </div>
140 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
141
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
142 <div data-type="order-of-operations">
143 <p class="problem">
144 <span data-if="USE_PAREN">
145 <code>(<var>A</var> + <var>B</var> \times <var>D</var>) - <var>C</var> \times <var>E</var></code>
146 </span><span data-else="">
147 <code><var>A</var> + <var>B</var> \times <var>D</var> - <var>C</var> \times <var>E</var></code>
148 </span>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
149 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
150
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
151 <p class="solution" data-forms="integer"><var>A + B * D - C * E</var></p>
152
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
153 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
154 <p data-if="USE_PAREN"><code>= (<var>A</var> + <var>B * D</var>) - <var>C</var> \times <var>E</var></code></p>
155 <p data-else=""><code>= <var>A</var> + <var>B * D</var> - <var>C</var> \times <var>E</var></code></p>
156 <p><code>= <var>A</var> + <var>B * D</var> - <var>C * E</var></code></p>
157 <p><code>= <var>A + B * D</var> - <var>C * E</var></code></p>
158 <p><code>= <var>A + B * D - C * E</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
159 </div>
160 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
161
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
162 <div data-type="order-of-operations">
163 <p class="problem">
164 <code><var>A</var> - <var>negParens(B)</var>^2</code>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
165 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
166
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
167 <p class="solution" data-forms="integer"><var>A - B * B</var></p>
168
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
169 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
170 <p><code>= <var>A</var> - <var>B * B</var></code></p>
171 <p><code>= <var>A - B * B</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
172 </div>
173 </div>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
174
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
175 <div data-type="order-of-operations">
176 <div class="vars" data-ensure="abs(B + C) < 11">
177 <var id="B">randRangeNonZero(-10, 10)</var>
178 <var id="C">randRangeNonZero(-10, 10)</var>
179 </div>
180 <p class="problem">
181 <code><var>A</var> - (<var>B</var> + <var>C</var>)^2</code>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
182 </p>
83ac4c8 Omar Rizwan Add order_of_operations exercise.
osnr authored
183
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
184 <p class="solution" data-forms="integer"><var>A - (B + C) * (B + C)</var></p>
185
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
186 <div class="hints">
8a73c5e Peter Collingridge Include negative numbers
petercollingridge authored
187 <p><code>= <var>A</var> - (<var>B + C</var>)^2</code></p>
188 <p><code>= <var>A</var> - <var>(B + C) * (B + C)</var></code></p>
189 <p><code>= <var>A - (B + C) * (B + C)</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
190 </div>
191 </div>
192 </div>
193 </div>
cde9e9f John Resig Re-run the exercises through the updated cleaner.
jeresig authored
194 </body>
195 </html>
Something went wrong with that request. Please try again.