The Code must be in Java   Write a program to calculate the following for each integer from 0 to 35: Print the current integer and one set of calculated values per line. Calculate the following for each value from 0 to 35: The square of the integer The cube of the integer The Fibonacci Number which occupies that integer’s position in the Fibonacci number sequence Given that the first few numbers in the Fibonacci sequence are 1, 1, 2, 3, 5, 8, 13 and 21, for the integer 6 the output would be “6   36        216      8”.  Print a header or title line for the table to show what each of the columns represents (abbreviate “square” to “sqr” for simplicity.) The table headers and numeric output should line up nicely. You must write the Fibonacci series part of the assignment with an ArrayList.  The point of this exercise is to practice with ArrayLists.  Everything you need to know about ArrayLists to do this was in the lecture and slides.  The other parts are simple multiplication operations. You shouldn’t use ArrayLists for them-just for the Fibonacci Sequence.  Create and fill the ArrayList first and then use a loop to generate the output. Once you have the program running properly, add the necessary code to it to send the output to a file named “Lab10.out.txt” on the computer. If you were to put the output of this program in Notepad, it may not appear to line up properly even though it lines up nicely in the Eclipse console. This warning is not telling you to submit the output.  Do not create a Class to hold all the data. You are only using most of it once, so create the ArrayList of Fibonacci numbers and then just calculate the other values

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

The Code must be in Java

 

Write a program to calculate the following for each integer from 0 to 35:

  • Print the current integer and one set of calculated values per line.
  • Calculate the following for each value from 0 to 35:
    • The square of the integer
    • The cube of the integer
    • The Fibonacci Number which occupies that integer’s position in the Fibonacci number sequence

Given that the first few numbers in the Fibonacci sequence are 1, 1, 2, 3, 5, 8, 13 and 21, for the integer 6 the output would be “6   36        216      8”.  Print a header or title line for the table to show what each of the columns represents (abbreviate “square” to “sqr” for simplicity.) The table headers and numeric output should line up nicely.

You must write the Fibonacci series part of the assignment with an ArrayList.  The point of this exercise is to practice with ArrayLists.  Everything you need to know about ArrayLists to do this was in the lecture and slides.  The other parts are simple multiplication operations. You shouldn’t use ArrayLists for them-just for the Fibonacci Sequence.  Create and fill the ArrayList first and then use a loop to generate the output.

Once you have the program running properly, add the necessary code to it to send the output to a file named “Lab10.out.txt” on the computer.

If you were to put the output of this program in Notepad, it may not appear to line up properly even though it lines up nicely in the Eclipse console. This warning is not telling you to submit the output. 

Do not create a Class to hold all the data. You are only using most of it once, so create the ArrayList of Fibonacci numbers and then just calculate the other values as you print them

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning