levo

Variables, Scope, Parameters and Identifiers

Annotation and program layout

  • 3 things to know
  • Component 1
Start revising · £5/month

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.

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.

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

Cram the night before, weakest topic first

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

KDW to HAT.
decryptsencryptscompresses

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.

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