|
- Create an HTML page with the name of the project and the instructions text on top.
- Add a <script> section and use a loop to print out all the numbers between 1 and 100, one per line.
- Next, for each number, also show the result of the number divided by 3, like this:
10 ... / 3 = 3.3333
11 ... / 3 = 3.6666
12 ... / 3 = 4.0
HINT : declare a string (var myLine) and for each line, add the elements you want to show to it. (myLine +=) Then print using document.write (myLine); when the line is "complete".
- Now change each line to show the remainder for each number divided by 3:
10 ... / 3 remainder = 0.3333
11 ... / 3 remainder = 0.666
12 ... / 3 remainder = 0.0
- Change your code to just say BIZZ if the number is divisible by 3, like so:
10...
11...
12...BIZZ.
- Now show BUZZ if the number is divisible by 5, like so
10... BUZZ.
11...
12...BIZZ.
- Make them print in the proper colors.
- EXTRA CREDIT - look up what MOD division is (HINT: the MOD operator is %) and use MOD to check if the number is evenly divisible.
|
|