Question: Must Validate without errors. JavaScript loops and document.write(): An arithmetic sequence is an ordered list of numbers with a defined starting point and a constant
Must Validate without errors.
JavaScript loops and document.write(): An arithmetic sequence is an ordered list of numbers with a defined starting point and a constant difference, d, from one term to the next. For example, the sequence starting at zero with d=3 is 0, 3, 6, 9, 12, ...
Write JavaScript to compute the first 20 terms of a sequence beginning at 7 with d=9. (To check your work, the first few terms are 7, 16, 25, 34.)
Use document.write() to place the result in a one-column table on your web page.
Name your document l4p1.html and create a link to it from your home page.
Note that you must compute the numbers using JavaScript; hard-coding them will not do! (Hint: the FOR loop is your friend.)
Your JavaScript code must also generate the necessary table row and table data tags.
Check your output carefully; errors will count against you.
Answer the following questions: What would you have to change to make your program produce the first 30 terms of the series?
Why did you have to use document.write() instead of alert() for this exercise? Include the answers in the same document as the table of numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
