levo

Programming

Sequence and selection

  • 3 things to know
  • AS Unit 1

Overview

Sequence in a program, two selection constructs found in most programming languages and condition in a selection statement.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Name the two selection constructs found in most programming languages.

Key term

Name four comparison operators used in conditions.

Key term

What is nested selection?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is meant by sequence in a program?

    Model answer

    Sequence means that the statements of a program are carried out one after another in exactly the order in which they are written.

  2. 2

    Give an example showing that the order of statements matters.

    Model answer

    Reading a value into a variable and then doubling it gives the intended answer, but doubling before the value has been read works on whatever happened to be in the variable already, so the answer is wrong.

  3. 3

    What is meant by selection?

    Model answer

    Selection is a construct that chooses between two or more different sets of statements according to whether a stated condition is true or false.

  4. 4

    Name the two selection constructs found in most programming languages.

    Model answer

    Most languages provide the IF statement, in its IF THEN and IF THEN ELSE forms, and a CASE or SWITCH statement.

  5. 5

    What is a condition in a selection statement?

    Model answer

    A condition is an expression that works out to either true or false, most often a comparison between a variable and a value.

  6. 6

    Name four comparison operators used in conditions.

    Model answer

    Four comparison operators are equal to, not equal to, greater than and less than.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Systems Analysis and Development Approaches
Design, Development and Testing
Implementation and System Security
Programming

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A check requires a value.
presencerangeformat

Blank Blitz makes facts automatic

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

ANormal data is 12, which should be accepted.
BBoundary data is 1 and 50, which should be accepted.
C0 and 51, just outside the limits, should be rejected.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

One byte is made up of 8 bits.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

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

Every question in Programming, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

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