February 18, 2025

Week 23 - Pseudocode practice

CLASS OBJECTIVE

Create and execute a program using pseudocode (algorithm written in your own words) to perform a specific task inside the classroom, so we can write our first program using words and statements.

To reinforce the concepts from our last class, today we'll begin creating our first programs. Before you start, there are a few key points and guidelines to understand.

  • First, you need to know the goal of the task—what the program is supposed to accomplish.
  • Next, take a sheet of paper and design the procedure, using program structures such as decision-making statements and loops, with a minimal set of instructions. Keep in mind that you should only include actions the program is capable of performing.
  • Once you've completed your program, you won’t be running it yourself; another entity, the Interpreter, will handle its execution.


ACTIVITY

PHASE 1. PROGRAMMER

  1. Pick a sheet of paper, select one of the next goals and write it on the paper as a title.
    • Open/Close window. Select the windows by its number.
    • Turn on/off the fan.
  2. Now, write the pseudocode using natural English, but structured in a way that reflects programming logic. Use the next reserved words list:
    • START
    • END
    • ACTIONS
      • Step_forward
      • Step_back
      • Turn_left
      • Turn_Right
      • Switch_on
      • Switch_off
      • Open
      • Close
    • IF condition DO
      • Action 1
      • Action 2
      • Action n
    • ELSE
      • Action 1
      • Action 2
      • Action n
    • (LOOP) WHILE condition DO
      • Action 1
      • Action 2
      • Action n
  3. You can stand up (respectfully) to test your program
  4. Once it's finished, write your student number (NO NAME) and give it to your teacher.


PHASE 2. INTERPRETER

To grade the pseudocodes, some students will take on the role of an Interpreter. This means they will follow the program’s instructions to evaluate its design.

  • The teacher will call on students one by one to stand up and execute a randomly selected program.
  • If the program doesn’t achieve the desired goal, the sheet will be returned to the programmer for corrections. 
  • If it works as expected, the programmer will simply add their name.



CLASS NOTES

As usual, write down the class title, the class objective, and answer the following questions:

  • Is this activity written in a programming language? Why or why not? What’s the difference?
  • When writing the program, did you use statements and delimiters? Provide an example.
  • Did you identify any reserved words? If so, name three of them.
  • Were there any variables in this activity? Was any data necessary to complete the task? If so, list it.