The Fibonacci sequence is: 0, 1, 1, 2, 3, 5, 8, 13, … The first two terms are 0 and 1, and each term thereafter is the sum of the two preceding terms. That is: Fib[n] = Fib[n - 1] + Fib[n - 2]. Using this information, write a C/C++ program that calculates the n th number in a Fibonacci sequence, where the user enters n into the program interactively.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter2: Database Design Fundamentals
Section: Chapter Questions
Problem 17RQ: List the changes you would need to make to your answer for Question 11 if the requirements change so...
icon
Related questions
icon
Concept explainers
Question

The Fibonacci sequence is: 0, 1, 1, 2, 3, 5, 8, 13, … The first two terms are 0 and 1, and each term thereafter is the sum of the two preceding terms. That is: Fib[n] = Fib[n - 1] + Fib[n - 2]. Using this information, write a C/C++ program that calculates the n th number in a Fibonacci sequence, where the user enters n into the program interactively. For example, if n=6, the program should display the value 5. See the example output in Figure 2.1.

 

 

Enter ID of applicant: 0123456789123
Enter age of applicant: 17
Enter income: 5523.55
Enter average mark: 88.54
===== ===== ===== ===== ===== ==
Summary of application
===:
====:
========== ======
IDnumber: 0123456789123
Age: 17
Income: 5523.55
Average mark: 88.54
Points: 8
Outcome: Accept
=========== ==:
====== ======
Do you want to process another application (Y|N)? N
Process returned 0 (0xe)
Press any key to continue.
execution time : 36.438 s
Figuur 1.2 / Figure 1.2
Transcribed Image Text:Enter ID of applicant: 0123456789123 Enter age of applicant: 17 Enter income: 5523.55 Enter average mark: 88.54 ===== ===== ===== ===== ===== == Summary of application ===: ====: ========== ====== IDnumber: 0123456789123 Age: 17 Income: 5523.55 Average mark: 88.54 Points: 8 Outcome: Accept =========== ==: ====== ====== Do you want to process another application (Y|N)? N Process returned 0 (0xe) Press any key to continue. execution time : 36.438 s Figuur 1.2 / Figure 1.2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Control Structure
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
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage