client-side web: assignment 2
 
jbwyatt.com

1. Come to class as there may be corrections, changes and additions.   20% late penalty per day.
2. Hand in a folder called "JS1" (by 10pm in your CLASS ACCOUNT)     Comment! (guidelines)
3. The folder, JS1 , should go into YOUR ACCOUNT
4. TEST before and AFTER the assignment has been uploaded to the server!

Create a folder, "JS1"

Create files called js1.htm, js1.css, js1.js
Link the files appropriately
The page should have 2 vertical, different-colored, side-by-side divs.
Use getElementById to find the proper html element and innerHTML to output in the left (fizzbuzz).
Use an array (store the numbers) and document.write to output in the right (fibbonaci).

LEFT

A paragraph with a single word, FizzBuzz, followed by a description of the function, that when clicked will invoke a function, FizzBuzz, that will:
  • Prompt and ask the user for a number, n (max 30, default 20).
  • Generate the numbers 1-n in a loop.
  • If a number is divisible by 3 & 5, output 'FizzBuzz' white on red.
  • If a number is divisible by 3, output 'Fizz' black on yellow background.
  • If a number is divisible by 5, output 'Buzz' white on black.
  • Otherwise simply print the number in black on white.
  • Use getElementById and innerHTML

RIGHT

A paragraph with a single word, Fibonacci, followed by a description of the function, that when clicked will invoke a function, Fibonacci, that will:
  • Use prompt to ask the user for a number, n (max 30, default 20).
  • Compute the first n Fibonacci numbers starting with the pair, 0 and 1.
  • Prompt and ask the user for a number, n (max 30, default 20).
  • After filling the array, print the contents of the array so that each number
  • is printed to a line with even numbers black on yellow and odd numbers white on black.
  • Use document.write() to output
TO HAND IN USE:
  - sambadrive on campus (you'll need your assignment on a flash drive)
  - fireftp on firefox at home
Put in your class account on jupiter.clarion.edu - on due date by 10pm
  - s_imstudent, password
  - courses/class_cis27001

WHAT TO HAND IN:
  - put your htm, css, js into the FOLDER that you created
  - put any image files (.jpg .gif .png) into the FOLDER that you created
  - hand in the ENTIRE FOLDER