Sudocode

Pseudocode
1 / 18
next
Slide 1: Slide
AstronomyUpper Secondary (Key Stage 4)GCSE

This lesson contains 18 slides, with interactive quizzes, text slides and 1 video.

time-iconLesson duration is: 60 min

Items in this lesson

Pseudocode

Slide 1 - Slide

Sudocode
What is this symbol?
What is abstraction?
a) Removing unnecessary data
b) Break down a task to smaller parts
c) Steps taken to complete a task
What is this symbol?

Slide 2 - Slide

Sudocode
What is this symbol?
Decision
What is abstraction?
a) Removing unnecessary data
b) Break down a task to smaller parts
c) Steps taken to complete a task
What is this symbol? Input/Output

Slide 3 - Slide

Sudocode
By the end of this lesson you will know what pseudocode is.

Slide 4 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
What is Pseudocode?

Pseudocode is a way of writing out the steps of a program using plain English mixed with simple programming-style structure.

  • It is not a real programming language.
  • It does not have strict rules.
  • Its purpose is to help you plan your code before actually writing it.

Think of pseudocode as writing instructions for a computer in a way humans can easily read and understand.

Slide 5 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
Why Use Pseudocode?

We use pseudocode to:

  • Plan our algorithm before coding
  • Avoid errors by thinking through the logic
  • Describe programs without worrying about syntax
  • Communicate ideas to others clearly

Slide 6 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
Pseudocode syntax
Start/End
Algorithm start and end
Input
Data the user enters
Output
Information shown to the user
If/Else
Decision or a condition
Repeat/While
Loop x times or until x meets a condition

Slide 7 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
I do...
Problem:

Ask the user for two numbers and display the larger one.

Slide 8 - Slide

Slide 9 - Video

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
WE DO — Guided Practice

Task: Write pseudocode for a program that:

  • asks the user for their age
  • checks if the age is 18 or older
  • outputs “Adult” if age ≥ 18
  • outputs “Child” if age < 18

Slide 10 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
WE DO — Guided Practice

START
    INPUT ________
    IF ________ >= 18 THEN
        OUTPUT "________"
    ELSE
        OUTPUT "________"
END




  • age
  • age
  • Adult
  • Child

Slide 11 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
WE DO — Guided Practice

START
    INPUT age
    IF age >= 18 THEN
        OUTPUT "Adult"
    ELSE
        OUTPUT "Child"
END




Slide 12 - Slide

Which of the following correctly shows a condition in pseudocode?
A
IF
B
REPEAT
C
INPUT
D
START

Slide 13 - Quiz

If their age is 18 what would the system output?
A
Adult
B
Child

Slide 14 - Quiz

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
You do - Independent practice

Task: Write pseudocode for the following problem on your own:

Problem:

  • A security system asks the user to enter a 4-digit PIN.
  • The PIN must not be "1234" or "4321".
  • If the PIN is valid, output "VALID PIN".
  • Otherwise, output "INVALID PIN".

Slide 15 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
You do — Independent Practice

_________
______ pin
_____ length of ______ ≠ __    _______
        _______ "INVALID PIN"
    _______ IF ______ = "1234" ______ pin = "4321" THEN
        OUTPUT "_________"
    _________
        ___________ "VALID PIN"
_________

Slide 16 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
You do — Independent Practice

START
INPUT pin
        IF length of pin4    THEN
                PRINT "INVALID PIN"
        ELSE IF pin = "1234"  OR  pin = "4321" THEN
                 OUTPUT " INVALID PIN "
        ELSE
                 PRINT "VALID PIN"
END

Slide 17 - Slide

Sudocode
LO - By the end of this lesson you will know what pseudocode is.
You do — Stretch

The height a student jumps in the high jump needs to be input and validated. The height is entered in centimetres (cm) and must be between 40.0 and 180.0 inclusive.

Write an algorithm to:

• take the height jumped as input
• output "VALID" or "NOT VALID" depending on the height input.


Slide 18 - Slide