flow charts and pseudo code

7
BBBIT

Upload: listergc

Post on 10-Jun-2015

3.068 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Flow Charts and Pseudo Code

BBBIT

Page 2: Flow Charts and Pseudo Code

BBBIT

By the end of today’s lesson;• All of you will understand the purpose of

pseudo code and flow charts (D-E)• Most of you will be able to write some

clear pseudo code and be able to translate others work (B-C)

• Some of you will add complicated functions into their pseudo code to make it complete advanced skills (A*-A)

Learning outcomes

Page 3: Flow Charts and Pseudo Code

BBBIT

How do you make a cup of tea? Is it anything like this?

Flow charts

Page 4: Flow Charts and Pseudo Code

BBBIT

Create a flow chart for how you would make a cup of tea or coffee using only these symbols?

Your turn

Page 5: Flow Charts and Pseudo Code

BBBIT

What is pseudo code?

This is when you write you ideas for a program in plain English to give you a good idea of how to structure your coding.

PSEUDO CODE

Page 6: Flow Charts and Pseudo Code

BBBIT PSEUDO CODEIf student's grade is greater than or equal to 60

Print "passed" else

Print "failed"

Begin one's move. Throw the dice. Move the number of spaces on the board shown on the dice. If the token landed on "Go to Jail,"

then go there immediately. Else if the token landed on "Chance" or "Community Chest,"

then draw a card and follow its instructions. Else

follow the usual rules for the square (buying property, paying rent, collecting $200 for passing "Go", etc.). End one's move.

Page 7: Flow Charts and Pseudo Code

BBBIT

How do we write it?We literally write the step by step guide of what is in our heads. If there is ever a ‘decision’ to be made then this is done like this;Leave the houseWhile not at station

Walk towards stationEndWhile train is not at station

Wait for trainEndGet on train

Pseudo Code