Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How the Fibonacci sequence works, is that starting with 1, each time we need the next value, we will add the two previous values together.

How the Fibonacci sequence works, is that starting with 1, each time we need the next value, we will add the two previous values together. For example, we start with 1, then 2. The next number is 3 or 2+1. After that, we take 2+3, or 5, then 8 (3+5), 13 (5+8), etc.

MUST BE WRITTEN IN JAVASCRIPT, Notepad++

-The page should first prompt the user for a number of steps they'd like in the sequence.

-This should be taken and stored in a variable. Ensure that we parse an integer value for this.

-Afterwards, we want to do validation.

-We should first check if the value is NaN, and if it is, we should print out that we need a number, and we shoudl not do the rest of the program.

-If the number of steps is less than or equal to zero, we should print out that we need at least one step, and we should not do the rest of the program.

-Create an array to store each number in the sequence.

-Create a loop to put each number of the sequence into the array, until we've reached the number of steps that the user wanted

-Create another loop to print a new element for each value in the array, and ensure that the value is in the

element.

-Document your code with comments, describing the purpose of functions, code blocks, and individual lines

-Generally, our rule of thumb should be that if you read the comments, you should be able to tell what each of the following lines of code is for.

======================= ========GRADING======== =======================

Technical Level Does the site meet the criteria listed above? 1 2 3 4

Does the site display a correct result for the problem it is attempting to solve? 1 2 3 4

Do the comments document code blocks and individual statements to provide a clear demonstration of the purpose of each? 1 2 3 4

Problem Solving/Critical Thinking Does the site display consistent naming and proper use of syntax? (This should apply not only to the javascript, but the html, css, and file names of the site) 1 2 3 4

Does the site display an efficient solution to the problem, given the concepts and coding practices covered in the course? 1 2 3 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions