2018-04-23

posted Apr 22, 2018, 8:36 PM by Konstantinovich Samuel
What if we wanted to create a webpage that has a table of:
n   and  n to the 2nd power.

DO NOW: Oh paper create the html that would make the table with the 5 rows shown here:  (assume a normal table, no style or anything crazy)
    n   n^2
    0   0
    1   1
    2   4
    3   9





CLASSWORK/ HOMEWORK:

Lab Website 02:
All related files for this lab should be placed in 

~/public_html/02tables/

1. tableSquares.html
Create the file:
~/public_html/02tables/tableSquares.html

Make a simple html table with the numbers from 0 to 3000 inclusive, and the square of that number just like you created above. 
    n   n^2
    0   0
    1   1
    2   4
    3   9
    ...
    ...  (you need to fill in a ton of lines)
    ...
    3000 9000000

Discuss with your neighbors:
    How can you do this using all the tools you have learned in this class?

2.  tablePrimes.html
Create:
~/public_html/02tables/tablePrimes.html

Make a simple html table with the number n from 1 to 3000 inclusive, along with the nth prime along side it. 

e.g.

n  nth prime
1  2   
2  3
3  5
4  7
5  11
6  13
7  17
...
3000  [whatever the 3000th prime is]

Discuss with your neighbors:
    How can you do this using all the tools you have learned in this class?
    What function do you need in order to create this?
    How many ways can you create a function like that?





Comments