Mixed Practice: Flowchart u0026 Pseudocode Conversion Quiz Quiz

Sharpen your skills in translating between flowcharts and pseudocode with these medium-level conversion questions. This quiz covers flowchart interpretation, pseudocode structure, and common logic patterns to strengthen understanding for programming and algorithm design.

  1. Sequence in Flowcharts vs Pseudocode

    When converting the flowchart segment 'Start → Input X → Output X + 2 → End' into pseudocode, which of the following is the clearest equivalent?

    1. Begin; Read X; Print X + 2; End
    2. Start; Input X + 2; Output X; End
    3. Start X; Input X; Show X * 2; Stop
    4. Begin Input; Output X + 2; End X

    Explanation: The correct answer matches the process in the flowchart: reading a value, then outputting that value plus two. Options B and D either multiply or incorrectly order the input and output steps, while C combines steps and labels in a confusing order. The original flowchart sequence is preserved best in the first option.

  2. Conditional Structure Identification

    Given the pseudocode: If age u003E= 18 then Output 'Adult' else Output 'Minor' endif, which flowchart symbol should be used for the decision-making step?

    1. Parallelogram
    2. Diamond
    3. Oval
    4. Rectangle

    Explanation: The diamond is the standard symbol for decision or conditional operations in flowcharts. Rectangles are used for processes, parallelograms for input/output, and ovals for start or end points. Only the diamond accurately represents a branching logical condition in this scenario.

  3. Loop Representation Conversion

    How should a flowchart with a loop labeled 'Repeat Input number until number u003E 10' be written in pseudocode?

    1. If number u003E 10 then Input number
    2. Repeat Read number until number u003E 10
    3. For number u003E 10: Input number
    4. Do Input number while number u003C 10

    Explanation: The correct option directly mirrors the loop logic from the flowchart, indicating repetition based on a condition. Option B describes a for loop, which is inappropriate here. Option C reverses the condition, and D uses a conditional, not a loop. Only the first maintains the correct repetition until the specified condition.

  4. Matching Terminology: Start/End Symbols

    In converting pseudocode keywords 'Begin' and 'End' to flowchart symbols, which shapes should be used for both?

    1. Rectangles
    2. Ovals
    3. Diamonds
    4. Hexagons

    Explanation: Ovals are universally used to represent Start and End (or Begin and End) points in flowcharts. Rectangles represent process steps, diamonds are for decisions, and hexagons are not standard for these actions. The selection of ovals ensures clear, widely-accepted flowchart structure.

  5. Pseudocode for Parallel Processing

    If a flowchart shows two input steps (Input Name and Input Age) happening independently before merging, which pseudocode best reflects this sequence?

    1. Input Name followed by Input Age;
    2. Read Name; Read Age;
    3. Age Name Input;
    4. Read Name then Read Age;

    Explanation: The best pseudocode representation is a sequence of independent input commands, as in 'Read Name; Read Age;'. The second and fourth options imply strict sequencing with 'then' or 'followed by', while the third mixes the variables irrationally. Only the first option fits the parallel and then merged design of the original flowchart.