Question: Must be in C++ languag undefined Create a console app to calculate a Fibonacci number(See Fibonacci in Wikipedia if you don't know what is Fibonacci
Must be in C++ languag
undefined
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 (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; Your app runs like the screenshot below: Microsoft Visual Studio Debug Console Enter an index number (>= 2): 15 The 15-th Fibonacci number: 610 D:\Teaching Spring2021\CPSC246\Homework\HWe2\Fibonacci\Debug\Fibonacci.exe (process 31648) exited with code e. 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
Get step-by-step solutions from verified subject matter experts
