The following is my class project and I do not have a clue where to begin. Could someone at least point me in the right direction?

For this project we are going to work with computing the Fibonacci Sequence (also called Fibonacci Number). We will be using a menu to control this programâ€™s execution. The program should clear the screen each time the menu is displayed. The menu should display the following options:

0. Exit Program
1. Fibonacci For
2. Fibonacci Do
3. Fibonacci While

The user should be able to enter a number between 0 and 3, each number will coorespond to one of the menu options listed above. The menu should loop continuously until the user enters 0 to exit the program. You should use a switch statement to control the calling of the appropriate function.

The program should have 3 functions one for the for loop, one for the do loop and one for the while loop.

Clear the screen, then ask the user each time how many iterations of the Fibonacci Sequence he/she would like to see before calling the function to display the output.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by ccoleman52932

Which part do you want help with? for starters, determining the fib sequence will look something like this:

``````int[size] num;
num[0]=1;
num[1]=1;
int index=2;
while(notdone) {
num[index]=num[index-1]+num[index-2];
index++;
}``````

but you'll have to tweak it to fit what you want it to do. :)

Which part do you want help with? for starters, determining the fib sequence will look something like this:

``````int[size] num;
num[0]=1;
num[1]=1;
int index=2;
while(notdone) {
num[index]=num[index-1]+num[index-2];
index++;
}``````

but you'll have to tweak it to fit what you want it to do. :)

Thanks, the information that you provided was helpful.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.