CSCI 51A / ECE 86 - Lab #6
Lab #6 is worth 100 points.

Initial design document is due in lecture on 4/13/05.
Completed lab is due on or before Sunday, 4/24/05.
Late submissions will lose 2% per day.

Objectives:

Description:

Be sure that you study the structured programming techniques presented in Chapter 6 before proceeding with this lab.

Write a program that will allow a user to determine whether a specified integer is a prime number, or is a Fibonacci number. The program should prompt the user to select a function, P for prime or F for Fibonacci, and should repeat this prompt until a valid selection is made. Once the user has selected a function, the program should prompt the user to enter a number. The requested test should be performed on the number and the result printed out. Finally, the user is asked if they would like to repeat the process. When the user is finished, return control to the simulator. A sample dialog follows:

Select Prime or Fibonacci [F/P]: F
Enter a number: 21
21 is a Fibonacci number
Repeat? [Y/N]: Y
Select Prime or Fibonacci [F/P]: N
Select Prime or Fibonacci [F/P]: P
Enter a number: 32
32 is not a prime number
Repeat? [Y/N]: Y
Select Prime or Fibonacci [F/P]: F
Enter a number: 14
14 is not a Fibonacci number
Repeat? [Y/N]: N

Here are a few more requirements:

Here are a few hints:

Turn-in Procedure

In WebCT, click on the Assignments icon to submit your zip file for grading.