Pseudocode & flowcharts

Computer Science · Programming fundamentals

Question 1 of 10

0

    In the flowchart symbol key, what does the rectangle labelled B mark?

    Diagram for the question: In the flowchart symbol key, what does the rectangle labelled B mark?

    Capital letters and accents are ignored.

    Stuck? Read the explanation

    Unlocks at a streak of 5 correct answers in a row.

    Print a free worksheet (PDF)

    Embed this practice on your site or class page

    Paste this HTML into your page. Students practise right there; it is free and needs no account.

    Pseudocode & flowcharts explained

    Pseudocode and flowcharts are two ways to plan an algorithm before writing real code. Pseudocode describes the steps in structured, plain-English text. A flowchart shows the same steps as boxes and arrows. Both let you check the logic without worrying about the exact syntax of a language.

    Common flowchart symbols are an oval for start and end, a rectangle for a process, a parallelogram for input or output, and a diamond for a decision with yes and no branches. Pseudocode uses keywords such as INPUT, OUTPUT, IF, THEN, ELSE, WHILE and FOR. Exam boards have their own preferred style, so follow the one your course uses.

    This pseudocode adds the numbers 1 to 5:

    total ← 0
    FOR i ← 1 TO 5
        total ← total + i
    NEXT i
    OUTPUT total
    

    A common mistake is to write a loop with no way to stop, such as a WHILE condition that never becomes false. This creates an endless loop, so always check that something inside the loop changes the condition.

    Worked example

    Trace the loop above, starting with total = 0 and adding i for i = 1 to 5.

    1. i = 1: total = 1
    2. i = 2: total = 3
    3. i = 3: total = 6
    4. i = 4: total = 10
    5. i = 5: total = 15

    The output is 15, which is the sum of the numbers 1 to 5.

    What you will practise

    40 diagrams. Type the label for each part and get instant feedback.

    Example questions

    • In the flowchart symbol key, what does the oval labelled A mark?
    • In the flowchart symbol key, what does the rectangle labelled B mark?
    • In the flowchart symbol key, what does the parallelogram labelled C mark?
    • In the flowchart symbol key, what does the diamond labelled D mark?
    • In the flowchart symbol key, what is the symbol labelled E called?
    • In the pass-or-fail flowchart, what does the shape labelled A represent?
    • In the pass-or-fail flowchart, what type of symbol is the diamond labelled C?
    • In the pass-or-fail flowchart, what kind of operation is shown in the parallelogram labelled B?

    …and 32 more.