The Fibonacci sequence is a sequence where the next number in the pattern is the sum of the previous two numbers. The first 7 terms of the Fibonacci sequence are 1, 1, 2, 3, 5, 8, 13.Write pseudocode to print the first 15 terms in the Fibonacci sequence.
What will be an ideal response?
num terms = 15
num x = 1
num y = 1
num z = x + y
num currentTerm = 3
print x
print y
print z
while currentTerm < terms
x = y
y = z
z = x + y
print z
currentTerm = currentTerm + 1
endwhile
You might also like to view...
Which of the following is not true about the mesh?
A. You can change its size. B. You can change its color. C. It is necessary to create distortions. D. It is controlled by the View Options section of the Liquify dialog box.
Which of the following is the correct order for the steps of laser printing?
A. Processing, charging, developing, exposing, transferring, fusing, cleaning B. Processing, developing, charging, exposing, fusing, transferring, cleaning C. Charging, processing, exposing, developing, transferring, fusing, cleaning D. Charging, processing, developing, exposing, transferring, cleaning, fusing E. Processing, charging, exposing, developing, transferring, fusing, cleaning