
Primates do Primes
1. Ask the user how many primes they want. Calculate as many primes as the user wants and display a list of them. Remember that 1
is not a prime number. The first prime number is 2.
Hints:
To find out if one number is divisible by another, use the mod block in Operators. This tells you the remainder of
division. For example, 7 mod 3 is 1 because 7 divided by 3 has a remainder of 1.
Before you create your script, write down what your program will do on a piece of paper. For example, what numbers do
you need to divide by to figure out if a number is prime? When can you stop? What blocks will you use?
2. Name your project Primates do Primes and save it.
Kommentare zu diesen Handbüchern