CLASS OBJECTIVE
Reinforce the use of REPETIR and SI_ENTONCES commands by creating a new algorithm in PSeInt, but this time using a flowchart as a visual support. This new algorithm's purpose is to analyze a number to determine whether is a prime number or not.
INTRODUCTION
Today you're going to create a new algorithm to determine prime numbers. You already know the commands and the programming structures, except for the MOD operator, but you'll find it's a very simple mathematic operator related with division.
MOD OPERATOR
You're going to use a new operator, its name is MOD and the symbol that represent it is %.
In this case, it doesn't mean "percentage", in this case means REMAINDER of a division.
For our practical purpouses, you must know that every time you get zero as a remainder it means you found an exact divisor.
Try the next algorithm in PSeInt:
If you try 42 as dividend and 8 as divisor the remainder will be 2.
If you try 21 as dividend and 7 as divisor the remainder will be 0. It is an exact divisor.
This two numbers might have many exact divisors but, what about prime numbers like 23?
Prime numbers just have two divisors: one and itself.
CLASS ACTIVITY
- Create a new file in PseInt
- Start naming the algorithm as NĂºmeros_primos, without spaces, for the algorithm and the file. Remember the difference between the algorithm name and the file name, in which you can use spaces.
- Now, you're going to use the next flowchart to create the algorithm in PSeInt. Remember, you have to type commands and operators, or you can click on the left and right panels instead to insert then in the algorithm.
CLASS NOTES
Write down in your notebook the title of the class, the objective and follow the instruction.
- Write down the algorithm code from PSeInt in your notebook and explain, using your own words, what does every code line do, from the first until the last.
Show your answers to your teacher.


