Get a random number by calling the randomNumber
function and
store it in a variable.
Display the random number in the #num1
field, where you
currently see x
.
Every time you refresh the page, a new number should appear.
Repeat challenge 1, but this time update the #num2
field,
where you currently see 5
.
#num1
and #num2
should be different numbers
unless they randomly happen to be the same (rare!)
Calculate the sum of the two numbers and display them in
#answer
field, where you currently see y
.
Call the randomOperator
function and store the returned value
in a variable.
Update the #operator
field to show the new operator
Call the solve
function and and pass it the values of num1,
num2, and the operator to get the answer. Update the displayed answer.
Update the randomOperator
and solve
functions in
lib/helper.js
to use "plus"
,
"minus"
, "times"
, and
"divided by"
instead of +, -, *, /
.
Add "modulo"
or %
to the list of operators. Limit the
possible values of num2 to 0 through 10 by passing min and max parameters
when you call randomNumber