Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fibonacci series is a set of numbers where the next number is the sum of the previous 2. So if the first number is 0

Fibonacci series is a set of numbers where the next number is the sum of the previous 2.

So if the first number is 0 and second number is 1, the next number number will be 0+1 = 1 and the series will be 0,1,1

The next number will be 1+1 = 2 and the series will be 0,1,1,2 and the next will be 2+1 = 3 making the series 0,1,1,2,3. The next one being 3+2 = 5 then 5+3 = 8 and so forth.

For this assignment write a Fibonacci series for the first 10 numbers using JavaScript. The first two seed numbers will be 0 and 1.

Print the first 13 number of the series

0 1 1 2 3 5 8 13 21 34 55 89 144.

Load the series on body load. This means you will need to have you body tag as

You will need to write your function. Print the first two seed numbers outside your for loop using

document.writeln(number1);

document.writeln(number2);

After this inside your function you will need to create a for loop that will contain the rest of the series.

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago