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 easy 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 a remainder zero it means you found an exact divisor.
Try the next algorithm in PSeInt:
COMMENTS
This feature could be very helpful to remember how your PseInt algorithms work. Add comments using double slashes.
Everything you type after the slashes will be ignored by the interpreter, so you can add as many comments as you need.
// comentarios
ACTIVITY 1
- Start naming the algorithm, its name will be Números_primos, without spaces. Remember the difference between the algorithm name and the file name, in which you can use spaces.
- For the file use the name Student name + números primos.
- 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.