Pseudocode & Flowcharts Flashcards

All 17 cards in this deck

Which flowchart symbol is a rounded rectangle (oval), and what is it used for?

The terminal symbol — the Start or Stop of the algorithm.

Which flowchart symbol is a plain rectangle, and what is it used for?

The process symbol — a calculation or an assignment to a variable.

Which flowchart symbol is a diamond, and what is it used for?

The decision symbol — a condition with two labelled exits (Yes/No).

Which flowchart symbol is a parallelogram, and what is it used for?

The input/output symbol — data entered into or sent out of the algorithm.

Which flowchart symbol is a rectangle with two extra vertical lines at its sides?

The sub program symbol — a call to a separate sub program.

What do the lines with arrowheads in a flowchart show?

The flow of control — the order and direction in which the symbols are followed.

What are the steps to work out the output of a flowchart for a given input?

e.g. input 5 to a flowchart that doubles a number then adds 1

  1. Start at the Start terminal and follow the arrows: number = 5
  2. Carry out each symbol's instruction, taking the branch that matches at a decision: 5×2=105 \times 2 = 10, then +1=11+1 = 11
  3. Record whatever reaches an output symbol: output 11

What are the steps to complete a missing decision in a partially drawn flowchart?

e.g. an empty diamond whose Yes branch outputs "Pass"

  1. Look at what each branch out of the symbol does: Yes gives "Pass"
  2. Work out the condition that must be true to take the Yes branch: score >= 50
  3. Write it inside the diamond, labelling both exits Yes and No

What are the steps to draw a flowchart for a described algorithm?

e.g. input a number and output "Big" if it is over 100

  1. Begin with a Start terminal and a parallelogram for each input: input number
  2. Add rectangles for processes and diamonds for decisions with Yes/No exits: number > 100?
  3. Add output symbols and a Stop terminal, joining everything with arrows: output "Big"

What are the steps to convert a flowchart decision into pseudocode?

e.g. a diamond "score > 50?" with Yes → output "Pass", No → output "Fail"

  1. Write the condition as an if: if score > 50 then
  2. Put the Yes branch underneath: print("Pass")
  3. Put the No branch after else and close: else print("Fail") endif

Which operators are accepted for concatenating (joining) two strings in pseudocode?

+, & or ., or a sensible function such as concat(). Commas are not accepted.

True or false? In pseudocode you can write word1 == "Hello" to store the string "Hello" in word1.

False. Assignment uses a single =; == is a comparison, not an assignment.

What is nested selection?

e.g. only checking the password once the username is correct

An if statement placed inside another if statement, so the inner condition is tested only when the outer one is true.

What is nested iteration?

e.g. a loop of 4 stars inside a loop of 3 rows

A loop placed inside another loop; the inner loop runs fully on every pass of the outer loop (here, 12 stars).

Give one way to refine an algorithm to make it more efficient.

Replace repeated lines of code with a loop (iteration).
e.g. one loop running five times instead of five separate input lines.

What are the steps to complete a missing line in a given function written in Exam Reference Language?
e.g. a function addBonus(score) that must add 10 to the score and give the new score back

  1. Use the parameters already given, with no extra inputs: use score
  2. Write the missing statement in correct syntax: score = score + 10
  3. Return the updated value: return score

When asked to complete missing lines of an algorithm, is a flowchart or structured English accepted instead of code?

Yes — as long as it makes clear exactly what the new lines do and does not simply repeat the question.