Create a PHP document that generates an exponentiation table.
0 | 1 | 2 | 3 | |
---|---|---|---|---|
1 | 1 | 1 | 1 | 1 |
2 | 1 | 2 | 4 | 8 |
3 | 1 | 3 | 9 | 27 |
PHP does not have an exponentiation operator; it does have a
pow()
function, but you can't use it ('cause I said
so!). Instead, write your own function (a real PHP function).
Format the table nicely (e.g., numbers should be right aligned). (No, my table is not formatted nicely.)
Your webpage must validate (using the validator at the W3C).
Use a form to collect the size of the table (the table above has size 3).
Alternate colors on the rows of the table.
The page should have three different reactions:
is_int()
and is_numeric()
;
one of these is better than the other.)Publish on webpub
/yardley
. Submit
a URL to the first page as Assignment 10 on KnightVision.
© 2007 Calvin College and Jeremy D.
Frens.
This work is licensed under a Creative
Commons Attribution-Noncommercial-Share Alike 3.0 United States
License.