avce ict unit 7 - programming session 9 – using pseudocode and structured english

9
AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Upload: donna-baker

Post on 12-Jan-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

AVCE ICT Unit 7 - Programming

Session 9 – Using pseudocode and structured English

Page 2: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Pseudocode

This looks like programming code but isn’t specific to any languageThe idea being that you can write a general program to hand to a programmer to developAdvantage: Quick, non language specific

Disadvantage: When you are learning to program this might

feel like an unnecessary step You have to get to grips with the real language

and this might be even more confusing

Page 3: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Structured English

A good place to start with a program is a statement of the user’s needs followed by a specificationThen write out in sentences what the program needs to do at each stepAll of the time, consider how a computer runs an event driven programVoila! You can write structured English!

Page 4: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Examples

A program for adding two numbers and displaying the result:

The user types in intNumber1The user types in intNumber2Add intNumber1 and intNumber2Display the total on the VDU screen

This isn’t programming code just yet..

Page 5: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Examples

Start with general sentencesRemove as many of the extra words as you can and just leave the bare minimumIf you are taking in input, use the term “read in” or “get”…..If you are displaying data, use the term “print out”All languages have commands to do these and mathematical and logical operations

Page 6: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Examples

Read in intNumber1Read in intNumber2intTotal=intNumber1+intNumber2Print out intTotal

Now this is like program codeBecause of this it is called pseudocodeStructured English is what it is written in

Page 7: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Examples

Write some pseudocode for the following programs: A program to total three numbers and

then find the average of all three A program for converting £ into

(Euros) Just do this last one one way if you wish

Page 8: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Documentation

You will get extra marks for having documented the design of your programYou can write out the program first using structured EnglishThis is a good thing to do as experienced programmers can “dry run” the program on paper first

Page 9: AVCE ICT Unit 7 - Programming Session 9 – Using pseudocode and structured English

Return to main Menu