Here is the question, I need help getting started on this please!

Write a program that asks the user for a number and then determines if the number is prime or not. This determination is done in a function called prime() that accepts an integer number and returns a result of prime or not. (Use a flag to do this). See appendix for how to determine if a number is prime and how to use flags. Here is the skeleton (pseudocode)

Setup your serial port in setup()

In the loop() function, ask the user for a number to check, N

Call the function prime() and pass to it the value of N. The function will return a flag that can be checked to see if N is prime or not

Inside the function, using a loop, check if N is prime

Do this by checking if N is divisible by any number from 2 to the square root of N.

Use the modulus (%) operator. If the remainder is zero, you found a factor and the number N is not prime.

Return a TRUE/FALSE flag value to the loop() function.