Question: Write, test, and debug (if necessary) JavaScript scripts for the problems that follow. When required to write a function, you must include a script to
Write, test, and debug (if necessary) JavaScript scripts for the problems that follow. When required to write a function, you must include a script to test the function with at least two different data sets. In all cases, for testing, you must write an HTML file that references the JavaScript file.
4.1 Output : A table of the numbers from 5 to 15 and their squares and cubes, using alert .
4.2 Output : The first 20 Fibonacci numbers, which are defined as in the sequence 1, 1, 2, 3, . . . where each number in the sequence after the second is the sum of the two previous numbers. You must use document.write to produce the output.
4.3 Input : Three numbers, using prompt to get each. Output : The largest of the three input numbers. Hint : Use the predefined function Math.max .
4.4 Modify the script of Exercise 4.2 to use prompt to input a number n that is the number of the Fibonacci number required as output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
