Unit 2. Developing Programming ToolsRevision Date: Jul 27, 2017 (Version 2.1)
This is the second session on algorithms
During the second session, the students will use pseudocode to describe an algorithm.
Students will write pseudocode using sequencing, selection, and iteration constructs.
Student computer usage for this lesson is: optional
Files in the Lesson Resources folder:
AlgorithmsPseudocode2.pptx : PowerPoint Slides for mini-lectures
Student Handout and Key for Matching Pennies Game
Student Handout for Rock Paper Scissors
Psuedocode Summary and Examples of common Algorithms.docx
Journal: Describe the algorithm of another student. Is there enough detail to allow somebody to follow the steps?
Walk through “Selection Statements”; “Iteration / Repetition” slides from the AlgorithmsPseudocode2 file in the Lesson Resources folder.
Things to stress with your students:
1. Whenever you need to store information, it must go into a variable. So think about what variables might be needed when you are creating your algorithm
2. Selection and Iteration statements require conditionals. Identify a conditional as something that returns a True or False answer. If selects the next statement to occur by answering the conditional question as being true or false. I have in the past pointed out the True and Then both start with T so TRUE always does the THEN, wherease Else and False both end with LSE, so when the answer if FALSE, you do the ELSE.
While continues to loop as long as the conditional answer is TRUE. When the conditional answer is false, the algorithm jumps to the statement after the End While.
3. Nearly all programming languages are equivalent in terms of being able to express any algorithm. Each has its own way to use variables, conditions and repetition which are needed for a solution to almost all algorithms.
During powerpoint, guide students through the Game of Matching Pennies (a student working copy and a solution key is in the Master Teacher Resource folder for this lesson).
Students work in pairs to create and share their pseudocode. Use the Rock Paper Scissors hand out to have student pairs psuedocode Rock Paper Scissors. If there is time, have groups switch algorithms and critique the algorithm of the other group.
Walk through pseudocode syntax summary handout called Pseudocode Summary and Examples of common Algorithms.docx in Lesson Resources folder.
Students work through challenges and check their results against sample solutions.
Review slide: "Why we have leap years."
Assign students to create pseudocode for leap years.
Pairing of students and crossing pairs to form groups of four should be used for the set of exercises that are part of this lesson.
Students will write pseudocode for algebra / geometry formulas. These will be entered into their class notes.
Students will write pseudocode for determining if a year is a leap year. This will be entered into their journals.