samedi 16 avril 2016

Javascript: Creates table based off User input (rows, columns, random number, and number input)

Write a javascript that will ask the user to create a table by asking user to enter number of rows, number of columns, and ask if user want to fill the cell with random numbers. If user entered “y” then your

program will generate random number to fill the table cells.

Your program will first display as the following: ( build a table button that initiates everything)

  • As soon as the user click on the button “Build a table”, your program will ask the user to enter rows, and

columns (here we entered 2 and 3 for rows and columns creating a table with such)

  • Your program will prompt the third screen to ask the user if table cells shall be empty, you can type in y

for yes and n for no. here we type in n (for not empty)

Note if we type in ‘y’ then your program will create a table of 2 rows and 3 columns with empty cells

  • Your program continue to ask if you want to generate random numbers to fill the cells. Type ‘y’ for yes

and ‘n’ for no. Here we typed in ‘y’ and press OK.

  • Note : if you type in no when ask if you want to generate random number then your program will ask you to enter numbers to fill in all the cells



Aucun commentaire:

Enregistrer un commentaire