March 23, 2025

Week 27 - Selection and loops practice

CLASS OBJECTIVE

Reinforce the use of the SI ENTONCES and the REPETIR commands by creating algorithms by yourself, just knowing the final result of the program.


INTRODUCTION

Last class you learned the use of SI ENTONCES to create multiple paths in an algorithm. By the analysis of  variables content the procedure can change and produce different outcomes.

Today you'll create by your self a program to analyze a word's length, obviously using SI ENTONCES, and after this you'll adapt the program to be repeated until the user chooses to exit.

Remember, you won't get any help from your teacher.



ACTIVITY 1

Remember, the activity's purpose is that you create the algorithm all by yourself so, you'll receive a just a couple of guidelines.

  1. Name the algorithm LONGITUD_DE_TEXTO
  2. Declare a variable to save a word
  3. Ask the user for a word and save it into the variable
  4. Tell the user IF the word's length has more than 15 characters (tip: you'll also have to use LONGITUD() function)
    • Otherwise, tell the user the word is smaller than 15 characters.
Look at the examples:




ACTIVITY 2

Now you have to add a loop to your first algorithm to repeat over and over until the user decides to finish it.

  1. Declare another variable to save a text
  2. You'll have to add the REPETIR/HASTA QUE command to wrap the last procedure.
  3. Inside the loop you'll have to ask the user if he wants to "try with another word", receive his answer and save it to the new variable.
  4. The algorithm will continue until the user types some letter different to the "s" letter.

Look at the examples:


If you need one last resource to finish your algorithm, look at the next flowchart:





CLASS NOTES

Write down in your notebook the title of the class, the objective and follow the instruction.

  1. What kind of data type you choose to save the user's incoming words? why?
  2. What does the LONGITUD() function do?
  3. Nested IF is a programing resource to add more answers to a SI-ENTONCES instruction,  Would it be possible to create a Nested IF in PSeInt? How?
  4. How did you indicate the "different to" comparison symbol?

Show your answers to your teacher.

March 15, 2025

Week 26 - Selections and Loops using PSeInt

 CLASS OBJECTIVE

Create in PSeInt an algorithm that uses selections and loops (programming structures) by analyzing a flow chart that describes every step of process.


INTRODUCTION

Any programming language must have the selections and loops programming structures because ane procedure has to make decisions or to repeat procedures. Obviously PSeInt has this two resources among others. The name of this two command are: SI-ENTONCES and  REPETIR


 




SI-ENTONCES
I'm sure it'll be difficult to understand the "written" version of this commands, but I'm sure you'll get use to it. Look at the SI-ENTONCES examples:

In the flowchart it looks like:


Indentation 
As you can see, it's not as difficult as it looked. To keep it simple you must always use the indentation to show the inner step of the procedure on the right.



ACTIVITY 1
Now open PseInt and type the next algorithm. What does it do?





REPETIR

REPETIR is a command to create a loop, in other words, the repetition of a list of actions. In the next example, a message will be shown over and over until the variable div decreases until cero.


Now in a flowchart look:

Never forget to use the indentation to identify the procedures in the selections or in the loops structures.




ACTIVITY 2
Now open PseInt once again and type the next algorithm. What does it do? Have you done something like this before?


Upload the two files (SI_ENTONCES y REPETIR_HASTA QUE) to the Classroom post.



CLASS NOTES

Write down in your notebook the title of this class and the objective. Using Raptor symbols, draw the next flow charts.

  • Draw the flow chart for the Activity 1
  • Draw the flow chart for the Activity 2

Show your answers to your teacher.



March 04, 2025

Week 25 - PseInt, Programming learning tool

CLASS OBJECTIVE

To know for the first time the programming learning tool named PSeInt and its working environment by creating two algorithms using different data types: characters and floating point numbers.



THIRD PERIOD COVER
To get started, you'll create the cover for Period 3, in no more than 10 minutes. The requirements are the following:

  • Period III written in  large size font
  • Technology III written below the period title
  • Your name, list number and group
  • A drawing allusive to Programming languages


INTRODUCTION

As you learned last class, before you start programming you have to know some basic rules of the programming languages: declare different variables types, the using of delimiters, the recongnition of sentences or code lines.

Today we'll start using PSeInt which is a very helpful tool to start learning programming languages. By the way, it works in spanish.

This is the PSeInt main window.


  1. This is the tool bar. In here you'll find tools like the save, save as, new, do and undo buttons. There are also two very important buttons here, the execute and the flowchart buttons.
  2. The main working area. This is where you're going to create the program by typing commands or operation names, right between the start and end algorithm points.
  3. The list of the available operations for data processing. For example: the basic mathematical operators, comparison operators, character operators, etc.
  4. The commands and programming structures. This is a helpful guide to remember how to interact with the user, how to analyze the information and how to use selections or loops in an algorithm.
To create an algorithm you'll have to type every sentence (code line) between "Algoritmo" and "Fin Algoritmo". Don't forget to name your program where the algorithm starts.


Variables

When using PSeInt, before you use variables you'll have to declare them. This means you have to reserve and name a memory space before you use it. How to do it? You´ll use the word "Definir", type the name and select data type.


  • Caracter is used to save letters and some symbols.
  • Entero is used to save integer numbers.
  • Lógico is used to save "true" or "false" answers.
  • Real is used to save decimal numbers.

There's only one way to learn how to use PSeInt, by creating programs.



ACTIVITY 1

Start naming the algorithm, its name will be Contador_de_caracteres. As you can see, you can´t use spaces.

Now try to type the next algorithm, I'm sure you'll have to correct some mistakes, it always happen the first time. For example, if you miss the semi-colon delimiter or the quotation marks PSeInt will inform you.

  • Escribir and Leer are "well known for you" commands (reserved words), to show information or to ask for information to the user.
  • Longitud is an operator to count letters in a string.



After you finish, press the "play" button to test it.

Save the file and, before you turn it in,  press the "flowchart" button. I hope it could be familiar for you.



ACTIVITY 2

For the second activity, you'll try to create the next by your self. 

The only different thing you'll need is a small arrow in the assignment formula. 

To get it, type <- (less than and dash)


Once again, after you finish, press the "play" button to test it.
Save the file and, before you turn it in,  press the "flowchart" button.


CLASS NOTES

Write down in your notebook the title of the class, the objective and answer the next questions.

  • What does "declare variables" means?
  • What are the four data types in PSeInt?
  • Which of those were used in today's activities?
  • What is the semicolon used for?
  • What are the Quotation marks used for?
  • How did you type the assignment arrow?

Show your answers to your teacher.