levo

Variables, Scope, Parameters and Identifiers

Annotation and program layout

  • 3 things to know
  • Component 1

Overview

Annotation in a program, how indentation helps a reader understand a program and three features of good program layout.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is annotation in a program?

Key term

Give two things a useful comment should record.

Key term

Why is a comment that restates the code useless?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is annotation in a program?

    Model answer

    Annotation is a comment written into the source code for a human reader. The translator ignores annotation completely.

  2. 2

    Give two things a useful comment should record.

    Model answer

    A useful comment records why a piece of code exists and any assumption it relies on. The purpose of a subprogram and its parameters are also worth recording.

  3. 3

    Why is a comment that restates the code useless?

    Model answer

    A comment such as add one to the counter repeats what the statement already says. The reader gains nothing and the comment must still be maintained.

  4. 4

    What happens to comments when a program is compiled?

    Model answer

    The compiler discards comments during translation, so they occupy no space in the object code. Execution speed is unaffected.

  5. 5

    Explain how indentation helps a reader understand a program.

    Model answer

    Indentation shows which statements belong inside a loop or a selection. The block structure becomes visible at a glance.

  6. 6

    State three features of good program layout.

    Model answer

    Good layout uses consistent indentation, blank lines between subprograms and one statement per line. A header block at the top of each module also helps.

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

See a huge jump in your memorisation

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

Data Structures: Arrays, Records and Hash Tables
Stacks, Queues, Linked Lists and Trees
Boolean Logic and Simplification
Algorithms, Pseudo-Code and Programming Constructs

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.

KDW to HAT.
decryptsencryptscompresses

Blank Blitz consolidates the facts

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

AThe two are not the same.
BOpen source refers to the availability of the code.
CMuch open source software is free of charge.

Build It trains answer structure

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

Backup means the copy of the data.
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 Variables, Scope, Parameters and Identifiers, 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.