Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

make/Create a page that displays the first 30 Fibonacci numbers. The output should look something like: First 30 Fibonacci Numbers 1 - 1 2 -

  1.  make/Create a page that displays the first 30 Fibonacci numbers. The output should look something like:
    • First 30 Fibonacci Numbers 
      • 1 - 1 2 - 1 3 - 2 4 - 3 5 - 5 6 - 8 7 - 13 8 - 21 ... 27 - 196418 28 - 317811 29 - 514229 30 - 832040  
  2. The output numbers in this sequence are the first two and then after the second number the sum of the previous numbers. To correctly output the numbers, use logic similar to the following:
    • Declare all variables needed.
    • Display your page title.
    • Display the first variable with a value of 1, example: "1 - 1"
    • Display the second variable with a value of 1, Example: "2 - 1"
    • Start a for loop giving the counter a value of 3.
    • Test the counter to ensure a value less than or equal to 30.
    • Assign a totalizer variable with the added values of the first and second variables.
    • Output the values of counter and totalizer each iteration.
    • Assign the first variable the value of the second.
    • Assign the second variable the value of the totalizer.
    • Increment the counter.
    • Test the loop again.
    • Use document.write to display the output.
    • Syntax help:
      • for (counter = 3; counter <= 30; counter++) {

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To create a page that displays the first 30 Fibonacci numbers you can use Java... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

What are the APPROACHES TO HRM?

Answered: 1 week ago

Question

What do you mean by dual mode operation?

Answered: 1 week ago

Question

Explain the difference between `==` and `===` in JavaScript.

Answered: 1 week ago

Question

=+a. Describe, in words, the event A and B.

Answered: 1 week ago

Question

=+b. Describe, in words, the event A or B.

Answered: 1 week ago