Ex1
Using JavaScript to write a program which will create an html like the following.
Ex-2
Write a JavaScript that outputs three tables. With each table output the annual balance after investing
1,000 with a fixed interest rate. Each entry of the table represent the balance after n years. Where n run
from 1 to 10. The first entry for year 1, second entry for year 2, etc.
Your program will output three tables with different interest rate. The first table with interest rate of
5%, second table with interest rate of 6%, and the last table has interest rate of 7%.
Note the background color for odd row of table shall be yellow and even row to be lightgreen.
Ex-3
Write a script that asks the user to enter 3 numbers then you will output three rows of stars that
corresponding to the numbers entered. Note the numbers entered by the user cannot greater than 20
or less than 5. The second screen shot was not acceptable since user entered 234 which is greater than
20.
The program will output three lines of stars. With the first one 10 stars in red, second line 15 stars in
yellow and the third line 12 stars in blue.
Ex-4
Write a JavaScript program which will ask user to enter two number between 1 and 20. Your program
will then output the number, its square, and its cube from the smaller number to the larger number one
at a row.
For example, if user enters 3 and 7 as shown below, your program will output, numbers from 3 to 7, and
their squares and cubes.
If a user enter invalid number, your program will continue to ask user until user enter a valid number.
The following showed a user entered an invalid number 23 (number must between 1 and 20) first and
the system then ask the user to enter a valid number. The user then enter 10 which is valid. The system
will then ask the user to enter another number. The user then entered 2 which is also valid. Although
the user did not enter numbers in ascending order, your program will compute squares and cubes from
2 to 10 rather than 10 to 2 as show below.
How to submit:
Create an index.html which contains all links to all the answers include extra credit
answer if you have. On top of this index.html, put your full name there.
Create a folder call it yourname-JS-1 and put ALL html documents into this folder.
Zip this folder and submit it to Canvas