levo

Programming Fundamentals

Sequence, selection and iteration

  • 3 things to know
  • J277/02
Start revising · £5/month

Overview

The three programming constructs, count-controlled and condition-controlled loops, the output of for, while and do … until loops, if … elseif, and switch … case.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Name the three basic programming constructs that control the flow of a program.

Process

What is sequence in a program?

Key term

What is selection?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    Name the three basic programming constructs that control the flow of a program.

    Model answer

    The three constructs are sequence, selection and iteration. Every program can be built from these three.

  2. 2

    What is sequence in a program?

    Model answer

    Sequence means instructions are carried out one after another in the order they are written. Changing the order can change the result.

  3. 3

    What is selection?

    Model answer

    Selection uses a condition to decide which block of code runs. The if statement and the switch statement both perform selection.

  4. 4

    What is iteration?

    Model answer

    Iteration repeats a block of code. The repetition continues a set number of times or until a condition is met.

  5. 5

    What is the difference between a count-controlled loop and a condition-controlled loop?

    Model answer

    A count-controlled loop repeats a fixed number of times, like a for loop. A condition-controlled loop repeats until a condition changes, like a while loop.

  6. 6

    How many times is Hi printed by for i = 3 to 7, print("Hi"), next i?

    Model answer

    The word Hi is printed 5 times. The variable i takes the values 3, 4, 5, 6 and 7, and both ends are included.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Systems Architecture
Memory and Storage
Computer Networks, Connections and Protocols
Network Security

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A bit is the unit of data.
smallestlargestmain

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

Integer means a whole number with no fractional part.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Programming Fundamentals, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.