Från verkligt problem till Datorprogram?. Du vet vad Du vill göra, men hur kommer man till ett färdigt C-program?. Morning routine. Get dressed. Eat breakfast. Go to school. Division. Time. Structure diagram. By 2IT Data students …. ”Morningwhile has gold in mouthd”. Morning routine.
Du vet vad Du vill göra, men hur kommer man till ett färdigt C-program?
IF you find basket
Get from laundry
Put on the clothes
Eat one pancake
WHILE pancakes <> 0
Go to school
IF money = 0
Take a cab
Move foot one step
WHILE distance to school <> 0Flow chart
Flowcharts are onedimensional. They are used when you have to describe exactly how the code is processed.
The Structure diagram is easier to follow.
Henrik Engström JSP-editor
Pseudocode is a compact and informal high-level description of a computer programming algorithm that uses the structural conventions of a programming language, but is intended for human reading rather than machine reading.
Example of pseudocode …
while not at end of listcompare adjacent elementsif second is greater than firstswitch them get next two elementsif elements were switchedrepeat for entire list