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.

Recommended Answers

All 2 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.