Pseudocode Flashcards

1
Q

What is pseudocode?

A

Pseudocode is is a way of showing an algorithm using text, and without being specific to a particular coding language. This means that pseudocode can be created in many different versions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What would be an example of pseudocode for making a cup of tea?

A
START
1) Fetch a cup and teabag.
2) Fill kettle with hot water.
3)Turn kettle on.
4)Put teabag in cup.
5)Wait for water to boil.
6)Pour water into cup.
7)Stir teabag.
8)Take out teabag.
9)Pour milk and sugar in cup (optional)
10)Serve tea.
END
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give the advantages of pseudocode.

A

Pseudocode is quick to write out and can easily be converted into any other coding language. Also, there is not one exact correct way to write pseudocode, as long as it makes sense to the person reading it. Also, this means that people with no experience of coding can understand and use the code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What would be the pseudocode for a company changing an employee’s password to a random 6 number password?

A
START
1)Take employee's current password
2)Change the letter into a number
3)Repeat this for every letter
4)Display the new 6-number password.
END
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name 5 pseudocode keywords and describe what they do.

A

PRINT- This displays something to the screen
INPUT- This is a way that a user can type a piece of data.
OUTPUT- This shows that something will appear on the screen.
WHILE- A loop that keeps going while a condition is true.
FOR- A loop that repeats the code inside them a number of times.
REPEAT- A loop that keeps going until the condition is true.
IF- A loop that allows you to check if a condition is true.
ELSE- Part of a loop that tells the program what to do if the loop is false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the disadvantages of pseudocode?

A

The disadvantages are that pseudocode doesn’t have the same structure as a flowchart, so it doesn’t have the full logic of the code. For someone who is inexperienced, it is difficult to understand the logic compared to a flowchart.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly