Prime

Write a program that determines whether a number is prime or not. The user must input a number into a textbox. When he/she clicks a button, the program must display a message in a label telling the user whether the number is prime or not. If the user inputs a number that is less than 2, display a message asking the user to input integers greater than 1.

You must tell the user the limitations of your program in another label. For example, if your program can only detect prime numbers up to 101 then display something like "Input any number between 2 and 101 to determine if it is prime or not." If the user inputs a number that is greater than your program's limit, ask the user to input integers less than that limit. Part of your grade will depend on how large the biggest prime number that your program can determine is.

You must use If statements. You may use an algorithm based on the Sieve of Eratosthenes.

Your program must follow standard Windows conventions as well as our Coding Standards. Name your project Prime.

Preconditions

Staple your printouts in the following order:

  1. code
  2. The screen capture of your actual form window at runtime after the largest possible prime number was inputted.