Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. Here’s an example list of prime numbers: 1 2 3 5 7 11 13 . .. NOTE: 4, 6, 8, 9

ID: 3615550 • Letter: #

Question

. Here’s an example list of prime numbers:

1 2 3 5 7 11 13 . ..

NOTE: 4, 6, 8, 9, 10, and 12 are NOT primenumbers.

Write a module or method (assume localvariables this time) to calculate and display whether or not anumber passed into the module or methodthrough the argument list is or is not a Prime number. YouMUST pass the number into the module.

Is it NOT necessary to write the complete algorithm, justthe module including an appropriate header, all statements to solvethe problem and the return statement.

HINT: to assist you, many programming languages havea way to change a floating point number into an integer number. You’re welcome to use a “predefined” modulecalled Int() to make that change. Here’s the moduleheader:

Integer Int(number floating point)

Here’s how such a module might be useful:

If (number – Int(number)) = 0 then

IsEven = true

End if

Think about when a number is divided by another number –there will either be a remainder or a 0. For this problem,what does a remainder tell you and what does a 0 tell you? You can use the Int() module to isolate the remainder and test for0 to help you.

Explanation / Answer

x.