Search Header Logo
Pseudocode Lesson 1

Pseudocode Lesson 1

Assessment

Presentation

•

Other

•

9th - 12th Grade

•

Practice Problem

•

Hard

Created by

Andre Purcell

Used 1+ times

FREE Resource

32 Slides • 14 Questions

1

media

2

media

What is Pseudocode?

English-Type

Words and Phrases

Easy Conversion to
Programming Code

3

media

IPO Chart

Data INPUT

PROCESS Data

OUTPUT Results

4

What is Pseudocode?

Pseudocode, is not a programming language, but simply an informal way of describing a program. It does not require strict syntax, but instead serves as a general representation of a program's functions. Since each programming language uses a unique syntax structure, understanding the code of multiple languages can be difficult.

techterms.com/definition/pseudocode

5

media
media
media

Pseudocode

6

Multiple Choice

Is pseudocode a programming language?

1

No

2

Yes

7

Multiple Select

Pseudocode is useful for which of the following? Choose ALL that apply.

1

to describe how an algorithm should work

2

to explain a computing process to less-technical users

3

to design code in a group setting

4

to show the correct syntax for Phyton

8

media
media
media

Pseudocode

9

media
media
media

Pseudocode

10

media
media
media

Pseudocode

12

Multiple Choice

Pseudocode is _________ and non-standard.

1

subjective

2

complex

3

language-specific

4

cryptic

13

Multiple Choice

When working on a project with others, try to use standard structures that are not specific syntax of a particular programming language.

1

True

2

False

14

media
media

Pseudocode Loops

​For loop – Commonly known as the repeat (x) { ... } loop.

Do while loop – Known as the repeat { ... } until (!CONDITION) loop.

Infinite loop – Known as the repeat forever { ... } loop.

For i = 1 To 5

OUTPUT i // would output each number 1 To 5

EndFor

15

media
media

Pseudocode Loops

​For loop – Commonly known as the repeat (x) { ... } loop.

Do while loop – Known as the repeat { ... } until (!CONDITION) loop.

Infinite loop – Known as the repeat forever { ... } loop.

games ← ['Fortnite', 'Call of Duty', 'Battlefield']

For i = 0 To 2

While games[i] != 'Battlefield'

i = i + 1

Endwhile

Endfor

16

Multiple Choice

Question image

The pseudocode represents a nested loop. Based on your observation, what best describes a nested loop?

1

A nested loop is a loop inside the body of the outer loop.

2

A nested loop is a loop alongside the body of the outer loop.

3

A nested loop is two loops running together.

4

A nested loop is a loop where one loop waits for the other is done before running.

17

Multiple Choice

Question image

If you wanted to display the name of the game found in each position of the array games[i], which line would you use.

1

OUTPUT games[i]

2

INPUT games[i]

3

OUTPUT games

4

INPUT games[i] on the screen

18

Multiple Choice

Question image

If you wanted to display the name of the game found in each position of the array games[i] ONLY once, where would you place the code?

1

Immediately after For i = 0 to 2

2

Immediately after 'For'

3

Immediately after i = i + 1

4

Before For i = 0 to 2

19

Multiple Choice

Question image

What would be displayed if i = 1 when OUTPUT games[i] is placed after i = i + 1?

1

'Call of Duty' will be displayed

2

'Fortnite' will be displayed

3

'Battlefield' will be displayed

4

Nothing because games[i] would be 'Battlefield' and the WHILE loop will be skipped.

20

Multiple Choice

Question image

If you wanted to add 'Forza' to the list, how would you edit the code?

1

Change 2 to 4 because there are now 4 items in the array

2

ADD 'Forza' to any position before 'Battlefield' in the array and change

For i = 0 to 2

to For i = 0 to 3

3

ADD 'Forza' to any position in array ONLY

4

You cannot add a new item because the array is limited to 3 items

21

media
media

Pseudocode Loops

​For loop – Commonly known as the repeat (x) { ... } loop.

Do while loop – Known as the repeat { ... } until (!CONDITION) loop.

Infinite loop – Known as the repeat forever { ... } loop.

Do

OUTPUT(fileVariable.readLine) // reads each line of the file until the file ends

Until fileVariable.endOfFile

22

media
media
media

Pseudocode Loops

Discussion questions

23

Multiple Choice

Question image

What is the value of Met if Num = 4, in 9.3.3? Show work.

1

Blu = (2*4)+4

Blu = 8+4 = 12

Met = 12+4-5

Met = 16-5 = 11

2

Blu = 2*(4+4)

Blu = 2*8 = 16

Met = 16+4-5

Met = 20-5 = 15

3

Blu = 2*4+4

Blu = 8+4 = 12

Met = 12+4-5

Met = 21

4

Blu = (2*4)+4

Blu = 8+4 = 12

Met = 12+4-5

Met = 16-5 = 10

24

Multiple Choice

Question image

How many times will 'OK' be displayed after the user inputs 'page', in 9.3.3 right?

1

0

2

1

3

2

4

4

25

Multiple Choice

Question image

How many times will 'Oh No' be displayed after the user inputs 'page', in 9.3.3 right?

1

0

2

1

3

2

4

4

26

Multiple Choice

Question image

When will 'Oh No' get displayed in 9.3.3 right?

1

If word is not equal to 'page'

2

The first time through the loop

3

Never

4

When word = 'page'

27

media
media
media
media

Pseudocode Example

• Input three numbers
• Add them together
• Show the results

28

Multiple Choice

Question image

Which option would display the average of the numbers?

1

Add (number1 + number2 + number3)/3

2

OUTPUT result (number1 + number2 + number3)/3

3

OUTPUT result (number1 + number2 + number3)*.3

4

Add/3

29

media
media
media
media
media

Pseudocode Example

• Input three numbers
• Add them together
• Show the results

Same Data Type

30

media

Pseudocode Example

• Input three numbers
• Add them together
• Show the results

Same Data Type and Output to Variable

31

media

Pseudocode Sequential
Statements

Executed one after the other
from the first to the last

Example 6:

32

media

Pseudocode Conditional
Branching

IF-THEN-ENDIF
IF-THEN-ELSE

33

media

Pseudocode Conditional
Branching

34

media

Pseudocode Conditional
Branching – Example 8

35

media

Pseudocode Conditional
Branching – Example 8

36

media
media
media
media

Pseudocode Conditional
Branching – Example 9

37

media
media
media

Pseudocode Conditional
Branching – Example 9

38

media

Pseudocode Conditional
Branching – Example 10
IF-THEN-ELSE

39

media

Pseudocode Conditional
Branching – Example 10
IF-THEN-ELSE

40

media
media
media
media

Pseudocode Conditional
Branching – Example 11

IF-THEN-ELSE

41

media
media
media

Pseudocode Conditional
Branching - IF-THEN-ELSE

42

media
media
media

Pseudocode Nested
Conditions

IF-THEN ELSE IF-THEN

43

media
media
media

Pseudocode Loops

44

media
media
media

Pseudocode Loops

45

media
media
media

Pseudocode Loops

46

media
media
media

Pseudocode Loops

pattern-tertiary
media

Show answer

Auto Play

Slide 1 / 46

SLIDE