Search Header Logo
GCSE Pseudocode

GCSE Pseudocode

Assessment

Presentation

Computers

10th Grade

Practice Problem

Hard

Created by

Andrew Dawson

Used 11+ times

FREE Resource

12 Slides • 15 Questions

1

media

GCSE CS

Pseudocode

2

What is pseudocode?

Pseudocode is a simplified language used to represent algorithms within your program. This language can be discussed between developers without the knowledge of any specific language.

An example would be creating a log in pseudocode algorithm to show how this module in the program works.

3

media

Here is a full list from the specification.

To make it easier to follow, key elements will all have upper case.

What do we need to know?

4

OUTPUT "Prints to screen"

This will output text to the screen.

OUTPUT

INPUT username

This will prompt for an input and store against the variable "username"

INPUT

Inputs and Outputs

5

Fill in the Blanks

Type answer...

6

Fill in the Blanks

Type answer...

7

Sets the variable age to the value zero. This is called assignment.

set age = 0

This simply creates a variable called age, it does not define the data type.

age

Variables

8

Variables

string: letters, numbers & symbols.

character

integer: whole number.

boolean: TRUE or FALSE

Data types

Creates a variable called age, and sets the data type of integer.

age IS integer

9

Example

username IS string

set username = " "

OUTPUT "Welcome to the program, what is your username"

INPUT username

10

Fill in the Blanks

Type answer...

11

Multiple Select

What data types can we set variables to?

1

integer

2

string

3

number

4

boolean

5

character

12

Array

Two types

myArray[5] -- This will have 5 spaces in this array.

myArray[1 to 5] -- This will store values 1, 2, 3, 4, 5.

13

Multiple Choice

I want an array that stores 10 values, which of the following is correct?

1

myArray[1]

2

myArray10

3

myArray[10]

4

myArray{10}

14

Multiple Choice

I want an array that stores values between 2 and 5, which of the following is correct?

1

myArray[2 to 5]

2

myArray2 to 5

3

myArray[5]

4

myArray{2 to 5}

15

Selection (making decisions)

IF found == TRUE THEN

OUTPUT "Found it"

ELSE

OUTPUT "Lost it"

END IF

Must be indented!

IF number >= 0 THEN

OUTPUT "Positive value"

ELSE

OUTPUT "Negative value"

END IF

If statement

16

Multiple Select

What are the components of the if statement?

1

IF

2

END

3

ELSE

4

THEN

5

END IF

17

Fill in the Blanks

media image

Type answer...

18

Fill in the Blanks

media image

Type answer...

19

SET x = 0

WHILE x < 5 DO

OUTPUT x

x = x + 1

REPEAT

while loop

FOR i to 4

OUTPUT i

NEXT i

for loop

Repetition

20

Fill in the Blanks

media image

Type answer...

21

Fill in the Blanks

media image

Type answer...

22

Fill in the Blanks

media image

Type answer...

23

Fill in the Blanks

media image

Type answer...

24

Subroutine

What is a subroutine?

A subroutine is a block of code that completes a function. The subroutine can be called at any point during the program to complete that task.

25

Subroutine example

DECLARE addTwoNumbers (x, y)

{Block of code to complete a task}

END SUBROUTINE

//

{How to call subroutine}

addTwoNumbers(2, 3)

26

Fill in the Blanks

media image

Type answer...

27

Fill in the Blanks

media image

Type answer...

media

GCSE CS

Pseudocode

Show answer

Auto Play

Slide 1 / 27

SLIDE