Pseudo code guide
Slides do conjunto (5)
-
- If the user has to input something you write INPUT and then the variable
- If the program has to output something then you write OUTPUT followed by what you are outputting in speech marks.
-
- For IF statements
- You write IF followed by the desired condition and then a THEN (instead of a colon). You can then write what happens next, making sure that it is on the line below and indented.
- You can use ELIF for any following conditions.
- Next you write ELSE followed by what happens next, making sure that it is on the next line and indented.
- Finish the IF statement by writing ENDIF at the bottom of the statement.
-
- For iteration:
- For a loop, you simply write REPEAT at the top of the code you want to repeat and then at the bottom of this code you write UNTIL followed by the condition.
- Make sure that the code you are looping is indented.
-
- REPEAT
- OUTPUT "Please enter a parcel number"
- INPUT parcel number
- IF parcel number has eight characters THEN
- OUTPUT "valid parcel number"
- ELSE
- OUTPUT "Invalid parcel number"
- ENDIF
- UNTIL parcel number has eight characters
-
- It is similar to python. At the top of your function write FUNCTION (then your function name).
- To jump to this function you just write the function name followed by ().
Informações
- Descrição
- Year 10 Computer Science Slides sobre Pseudo code guide, criado por Oscar Smith em 20-09-2018.
- Criado por
- Oscar Smith · set 2018
- Atualizado
- 27 set 2018
- Visualizações
- 1
- Avaliação