CSC 103 PROJECT 2



DUE DATE: FRIDAY OCTOBER 3 BY 4:00 P.M.



The Fibonacci Series is a series of numbers named after an Italian Mathematician. The Series is:

1, 1, 2, 3, 5, 8, 13, 21,...



Each member of the series is the sum of the previous two numbers.



Part 1: 20 points



Write a C++ program to read a positive integer number HowMany and print the first HowMany Fibonacci numbers. (In this and in the other parts, remember that reading a value includes prompting for the value.) The values must be printed five values per line and properly aligned in columns. Notice that the first two members of the series are 1 and 1. Save your program in the file Firstn.cpp.



Ex.:If the input to the program is 12, the output would be:



The first 12 members in the Fibonacci sequence are:

1 1 2 3 5

8 13 21 34 55

89 144







Part 2: 15 points



Write a C++ program to determine if a given number is in the Fibonacci sequence. Your program must read one positive integer value and print whether the number is in the sequence or not. Save your program in the file Isitfib.cpp.



Ex: If the input is 13, the output would be;



The number 13 is in the Fibonacci sequence.



Ex: If the input is 28, the output would be:



The number 28 is not in the Fibonacci sequence.







Part 3: 15 points



Write a C++ program to read two positive integer numbers Low and High and print all the Fibonacci numbers which are between Low and High (Including Low and High if they are part of the sequence.). If there are no such Fibonacci numbers, the program must print an appropriate message. The values must be printed as in Part 1. Save your program in the file Between.cpp.



Ex: If the input to the program is 50 and 144, the output would be:



The Fibonacci numbers between 50 and 144 are:

55 89 144



Ex: If the input to the program is 92 and 120, the output would be:



The Fibonacci numbers between 92 and 120 are:

none



Submit by e-mail as 103P2A, 103P2B, and 103P2C.