GCSE Computing – Algorithms

Lesson Aim

  • Understand algorithms (written in flowcharts or pseudocode), explain what they do
  • Produce algorithms in pseudocode or flowcharts to solve problem

Starter

Main

Theory Notes

Algorithms Theory

Exam Questions

Flowcharts task

Pseudocode Task

Plenary

Review initial learning through use of questions

Python – Practical Task

Lesson Aim

  • Use python skills gained to create a program to produce a solution
  • Design and implement a python program

Starter

How do we design a program.  Identify the variables, create an algorith and then produce the program

Main Task

Create a program which requests the length of the Opposite and adjacent sides of a right angled triangle and the calculates the Hypotenuse using the pythagoras theorem.

Extension

Modify your program to allow calculation of the other two sides.

Plenary

Review how to design a program – identfy variables and then  produce code

Gcse Computing – Guessing game

Lesson Aim

  • Create a program from scratch to solution

Your Task

You need to create a program which asks the user to guess a number between 1 and 10.  If the guess is higher ask the user to guess lower, and if the guess is too low ask the user to guess higher.

Extension Task

Generate a random number for the user to guess.

Limit the number of guesses to 5 if the user doesn’t get the number in 5 guesses print sorry you lost.

Creating a code breaker

Lesson Aim

  • Reinforce creating a program using Procedures and Functions

Your Task

Code Maker (and Breaker) – Lite Version
Write a program that will do the following:

         • Print a menu:
            Code Maker (and Breaker)
            1 – Encode a letter
            2 – Decode a letter
            9 – Exit

Enter an option:
• If ‘1’ is entered, prompt for a letter and use a selection statement to convert the letter into an integer (a = 1, b = 2, etc.).
• If ‘2’ is entered, prompt for an integer, check it is valid (prompt again if invalid) and convert the integer into a letter.
• If ‘9’ is entered, print a goodbye message and exit (break)
• If another value is entered, print an error message and print the menu again.