avce ict unit 7 - programming session 9 – using pseudocode and structured english
TRANSCRIPT
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
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!
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..
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
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
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
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
Return to main Menu