Web技术 第四章作业
———————————作业4.2—————————————
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 XHTML file that references the JavaScript file.
4.2 Output : The first 20 Fibonacci numbers, which are defined as in the sequence
1, 1, 2, 3, …
whereeach number in the sequence after the second is the sum of the two previous numbers. You mustuse document.write to produce the output.
结果截图:
———————————作业4.11—————————————
4.11 Function : counter
Parameter : An array of numbers.
Returns : The numbers of negative elements, zeros, and values greater than zero in the given array.
Note : You must use a switch statement in the function.
结果截图:
———————————作业4.13—————————————
4.13 Function : row_averages
Parameter : An array of arrays of numbers.
Returns : An array of the averages of each of the rows of the given matrix.
//输出第二个
结果截图:
因篇幅问题不能全部显示,请点此查看更多更全内容