Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a console app to calculate a Fibonacci number(See Fibonacci in Wikipedia if you don't know what is Fibonacci ) based on user's input. It

Create a console app to calculate a Fibonacci number(See Fibonacci in Wikipedia if you don't know what is Fibonacci ) based on user's input. It helps you review vector, conditional statement, and loop.Specification

image text in transcribed

Your app runs like the screenshot below :

image text in transcribed

(1) Run MS Visual Studio 2019 to create a Console App; (2) The app asks the user to input an index number (say n); (3) The app checks if the index number is less than 2 or not. If yes, the app shows an error message and exits with code 1; (4) Otherwise, the app uses a vector of integers to calculate and store Fibonacci numbers with index numbers from 0 to n. The formula is: Fibo = 0, Fib1 = 1, Fibn = Fibn-2 + Fibn-1; _ SM Microsoft Visual Studio Debug Console Enter an index number (>= 2): 15 The 15-th Fibonacci number: 610 D:\Teaching\Spring2021\CPSC246\Homework\HW02\Fibonacci\Debug\Fibonacci.exe (process 31648) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options ->Debugging->Automatically close the console when debugging stops. Press any key to close this window

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

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

What is the principle of a sine?

Answered: 1 week ago

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago