0% found this document useful (0 votes)
12 views18 pages

Pcode Powerpoint

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views18 pages

Pcode Powerpoint

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

PROBLEM SOLVING

Introduction To
Pseudocode Code

Teacher: Mr. Travis Morrison


Re-Cap/ Prior Knowledge

What is a flowchart?

A flowchart is a formalized graphic


representation of a logic sequence.

❖ work or manufacturing process


❖ organization chart
❖ or similar formalized structure.
What is an IPO Chart

IPO CHART IS A SIMPLE BUT EFFECTIVE


TOOL THAT PROGRAMMERS SOMETIMES
USE FOR DESIGNING AND DOCUMENTING
FUNCTION.

The three main characteristics of the IPO Chart


are:
1. Input
2. Processing
3. Output
CONVERT ALGORITHIM IN FLOW CHART

START

Input

Step 1: Input N1,N2,N3,N4

Step 2: GRADE ←

(M1+M2+M3+M4)/4

Step 3: if (GRADE <50) then


N Y
IS

Print “FAIL”

else
PRINT
• PRINT
“” Print “PASS”
• “”
endif

STOP
How do I get Minion Stuart to
move to D1?
A B C D

4
How do I get Minion Stuart to move
to C1 then to D4?

A B C D

4
How do I get Minion Stuart to move
to D2 then to C4, then move to A4
and finally to B3?

A B C D

4
What have we just done
• YOU HAVE CREATED A SERIES OF INSTRUCTIONS TO SOLVE
A GIVEN PROBLEM
• THIS IS ALGORITH
CALLED AN M

What will we be doing today


• WHEN WE WRITE IT IN A LIST OF PSEUDOCOD
INSTRUCTIONS IT IS CALLED E

SOME SIMPLE USE OF PSEUDOCODE ARE


• FOR GAME MAKING
• CREATING WEBSITES
• ANYTHING WHERE PLANNING IS NEEDED =
PSEUDOCODE IS USED TO LAYOUT THE TASKS/ACTIONS
Lesson Objectives

• IDENTIFY THE SEQUENCE OF ACTIONS TO SOLVE A PROBLEM

• DETERMINE THE ORDER OF A SEQUENCE TO CORRECTLY


SOLVE A PROBLEM

• DEMONSTRATE THE USE OF PSEUDOCODE TO SOLVE A


PROBLEM
Using Pseudocode

• PSEUDOCODE CAN BE USED TO HELP


LAYOUT THE CODE

WORKBOOK TASK 1
• WHAT IS THE SEQUENCE OF EVENTS TO
CREATE A SQUARE?
[WHEN YOU DRAW A SQUARE WHAT DO YOU DO]

• NOW WRITE THE LIST OF INSTRUCTIONS IN


YOUR WORKBOOKS
[WRITE OUT THE INFORMATION IN WORDS]
Algorithm Solution written in
pseudocode

1. MOVE FORWARD 100


2. TURN RIGHT 90 DEGREES
3. MOVE FORWARD 100
4. TURN RIGHT 90 DEGREES
5. MOVE FORWARD 100
6. TURN RIGHT 90 DEGREES
7. MOVE FORWARD 100
8. TURN RIGHT 90 DEGREES
CHECKPOINT
Identify the sequence
of actions to solve a
problem
• Created an series of
actions to solve a given
problem.
• This is called an
Algorithm

• Written the list of actions


in a numbered sequence
• This is called
Pseudocode
IN YOUR WORKBOOKS I WANT YOU TO THINK ABOUT
HOW TO GET MINION STUART TO MOVE AROUND THE
SQUARES AND COLLECT THE BANANAS.

A B C D

4
Algorithm Solution written in
pseudocode

1. Move right 2 squares


A B C D
2. Pick up banana
3. Move right 1 square
1 4. Move down 1 square
5. Pick up banana
6. Move left 2 squares
2 7. Pick up banana
8. Move down 1 square
9. Move right 1 square
3
10. Pick up banana
11. Move down 1 square
4 12. Move left 2 squares
13. Pick up banana
Program structure: Pseudocode Code

EVERY PROGRAM BEGINS AND ENDS IN THE SAME WAY..


PROGRAM MY_PROGRAM
BEGIN
STATEMENT1
STATEMENT2 ….
END
BEGIN
1. Move across 3 squares
2. IF you reach a banana
a. THEN Pick it up Ask the question – try and
start it with an ‘IF’

To give action– try and


start it with ‘Then’
CAN WE ASK A QUESTION?

A B C D

4
f rom
FINALLY an
u
k yo ison
Th Morr
Mr.

CAN YOU TELL ME IN


YOUR OWN WORDS
WHAT PSEUDOCODE IS?
Pseudocode

• Pseudocode is an informal basic


representation of the actual code that shows
how an algorithm or a computer program
works.

You might also like