Variables - named space in a computers memory that stores a value. i.e. first_name = "ted"
https://www.slideshare.net/DamianGordon1/pseudocode-10373156
https://www.slideshare.net/nicky_walters/pseudocode-flowcharts (there are also other useful programming presentations on this user's Slideshare page)
A method of writing up a set of instructions for a computer program using plain English. This is a good way of planning a program before coding.
INPUT – indicates a user will be inputting something
OUTPUT – indicates that an output will appear on the screen
WHILE – a loop (iteration that has a condition at the beginning)
FOR – a counting loop (iteration)
REPEAT – UNTIL – a loop (iteration) that has a condition at the end
IF – THEN – ELSE – a decision (selection) in which a choice is made
any instructions that occur inside a selection or iteration are usually indented
GET - retrieve the value from a variable
SET - assignment is the physical act of placing a value inside a variable
Pseudocode can be used to plan out programs. Planning a program that asks people what the best subject they take is, would look like this in pseudocode:
REPEAT
OUTPUT 'What is the best subject you take?'
INPUT user inputs the best subject they take
SET answer to the user's input
IF answer = 'Computer Science' THEN
OUTPUT 'Of course it is!'
ELSE
OUTPUT 'Try again!'
UNTIL answer = 'Computer Science'
SOURCE: https://www.bbc.co.uk/education/guides/z3bq7ty/revision/2
START
FOR i = 0, i<=10, i++
OUTPUT "i x 5 = " + i * 5
END
1. Var lives = 3
2. Var enemy_Array
3.
4. BEGIN GameLoop
5. MovePlayer()
6. CheckCollision()
7. END
8.
9. BEGIN MovePlayer
10. IF Right Arrow Pressed and player.x<stage.width
11. Player.x +=10
12. ELSE IF Left Arrow Pressed and player.x>0
13. Player.x -=10
14. END IF
15. END
16.
17. BEGIN CheckCollisions
18. FOR counter = 1 to enemy_Array:
19. IF enemy_array[counter] touching player
20. Lives -=1
21. IF lives <1
22. End Game
23. ENDIF
24. ENDIF
25. END FOR
26. END
1. Calculate the perimeter of a rectangle
2. Calculate the area of a triangle. The user will enter the height and width
3. Allow the user to enter their first name, last name and year of birth and calculate their age
4. Write pseudo code that performs the following: Ask a user to enter a number. If the number is between 0 and 10, write the word blue. If the number is between 10 and 20, write the word red. if the number is between 20 and 30, write the word green. If it is any other number, write that it is not a correct color option.
5. Write pseudo code that will perform the following.
a) Read in 5 separate numbers.
b) Calculate the average of the five numbers.
c) Find the smallest (minimum) and largest (maximum) of the five entered numbers
Input / Processing / Output tables can be used before writing structured pseudocode. IPO tables are a useful planning tool when determining what inputs you will need (helping to identify potential required variables), what processes and calculations will be undertaken, and what outputs your programs will generate. Completing an IPO table before writing pseudocode may assist the process of writing complete pseudocode and then creating a program.