levo

Fundamentals of Programming

  • 10 subtopics
  • 33 things to know
  • Paper 1

What Fundamentals of Programming covers

Data types, the statement types every imperative language is built from, subroutines and parameters, scope and stack frames, recursion, and the procedural and object-oriented paradigms. Examined on Paper 1.

Where it is assessed

Paper 1

The on-screen programming exam, 2 hours 30 minutes and 40% of the A-level.

Check the AQA specification ↗

The 10 subtopics

Each one has its own page. AQA AS Computer Science students sit this topic in the first year.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

A program counts how many pupils are in a room. Explain why integer is a better choice of type than real.

Evaluation

Describe the Boolean data type.

Key term

What is a user-defined data type?

Process

What are the three combining principles on which all imperative programming languages are built?

Numbers

Define indefinite iteration.

Key term

You need to keep asking the user for a password until the correct one is entered. Which position of the condition suits this, and why?

Process

Which arithmetic operations does a program need, and how do they group?

Process

What is 17 MOD 5, and how do the quotient and remainder relate back to the original number?

Key term

What does rounding do? Give the results of rounding 4.6 and 4.4 to the nearest whole number, and 3.14159 to two decimal places.

Key term

Why is testing two real numbers for exact equality unreliable, and what should you do instead?

Evaluation

A is True and B is False. Evaluate NOT A, A AND B, A OR B and A XOR B.

Key term

Explain the difference between a variable and a constant.

Key term

Give an example of a constant and of a variable, and say why naming a limit helps.

Process

Both P and Q are True. Which of P AND Q, P OR Q and P XOR Q are True?

Process

What does the length operation do? What is the length of 'Computing' and of the empty string?

Process

What does a string to float conversion do, and when do you need it rather than string to integer?

Key term

What does a date/time to string conversion do?

Process

What is the effect of seeding a generator with the same value twice, and when is that useful?

Evaluation

Explain the advantages of handling exceptions rather than letting the program stop.

Key term

What is the difference between a procedure and a function?

Process

What does passing a parameter by value mean?

Process

How does a subroutine return a value to the calling routine?

Key term

What happens when a local variable has the same name as a global one?

Key term

Explain how stack frames account for the two properties of local variables.

Key term

What happens if a recursive subroutine has no base case, or never reaches it?

Key term

Give the recursive definition of the factorial function.

Process

Describe the characteristics of the object-oriented programming paradigm.

Evaluation

Explain the advantages of the structured approach.

Key term

What is the difference between an attribute (property field) and a method?

Key term

What does a subclass inherit, and what can it do that its superclass cannot?

Process

How do you decide whether a relationship is aggregation or composition?

Numbers

What is an abstract method, and what follows for the class that contains one?

Key term

Explain the design principle 'encapsulate what varies'.

Take Fundamentals of Programming further

The same content, four other ways.

Commonly confused

Pairs that lose marks when they are blurred together.

  • Variable vs Constant

    Variable: a named store whose value can change during execution. Constant: a named value fixed before execution.

  • Procedure vs Function

    Procedure: a subroutine that performs a task without returning a value. Function: a subroutine that returns a value to its calling point.

  • Class vs Object

    Class: a blueprint defining shared fields and methods. Object: a particular in-memory instance of a blueprint.

Questions from this topic

Each one with the model answer underneath.

  1. 1

    What is a data type?

    Model answer

    A data type defines the set of values a variable of that type may hold, the operations that may legally be performed on it, and how the value is represented in memory. Declaring a type tells the translator how much memory to reserve for the variable and how to interpret the bit pattern stored there.

  2. 2

    Give three reasons why declaring the data type of every variable is useful.

    Model answer

    The translator can reserve the correct amount of memory and interpret the stored bit pattern correctly, and it can detect type errors before the program runs, for example an attempt to subtract one string from another. Declared types also document the programmer's intention for anyone later reading or maintaining the code.

  3. 3

    Describe the integer data type.

    Model answer

    A whole number with no fractional part, which may be positive, negative or zero — −7, 0 and 4096 are all integers. Unlike a real, an integer is held exactly, so comparing two for equality is safe and no rounding error accumulates. The arithmetic available on integers is the ordinary four operations, together with the pair that only makes sense for whole numbers: integer division, which discards any fraction, and the remainder that division leaves behind.

  4. 4

    Describe the real (float) data type.

    Model answer

    A number that may have a fractional part, for example 3.14 or -0.5. It is normally stored as a mantissa together with an exponent, so only a limited number of significant digits is kept and most real values are held as a close approximation rather than exactly.

  5. 5

    A program counts how many pupils are in a room. Explain why integer is a better choice of type than real.

    Model answer

    The value can only ever be a whole number, so an integer represents it exactly, occupies less memory and is faster to work with. A real would permit meaningless values such as 27.4 and, because reals are stored approximately, a test such as count = 27 could fail even when the count really is twenty-seven.

  6. 6

    Describe the Boolean data type.

    Model answer

    A type with exactly two possible values, True and False. It is what a relational or logical expression evaluates to, and it is used to control selection and iteration. Logically it needs only a single bit, although a language will usually reserve a whole byte for it.

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.

Fundamentals of Programming
Fundamentals of Data Structures
Theory of Computation
Fundamentals of Data Representation

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 driver is .
softwarehardwarestorage

Blank Blitz makes facts automatic

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

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It gets the exam shape right

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

Head means the first single element of a non-empty list.
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.

Fundamentals of Programming revision questions

Is Fundamentals of Programming examined at AS in AQA Computer Science?
Yes. It sits in Paper 1, which you take in the first year, so it is on the AS paper as well as counting towards the full A level.
What does Fundamentals of Programming cover in AQA AS-Level Computer Science?
10 subtopics: data types, programming concepts and program structure, arithmetic operations, relational operations, constants and variables, boolean operations, string-handling operations, random numbers and exception handling, subroutines, parameters and return values, variable scope and stack frames and programming paradigms and the procedural approach. Each one has its own page with questions and model answers.
How is Fundamentals of Programming organised?
By the AQA 7517 specification, subtopic by subtopic, so it matches the order you are taught it in.

Every question in Fundamentals of 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.