Fundamentals of Programming | AQA A-Level Computer Science (7517)

Fundamentals of Programming

  • 189 questions
  • 13 subtopics
  • Paper 1: the on-screen exam
  • Paper 1

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.

Sample questions from Fundamentals of Programming

Answer each one closed book first, then open the answer.

  1. Data types

    Describe the Boolean data type.

    Show the 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.
  2. Programming concepts and program structure

    Describe an iterative structure with the condition at the start, and say how many times its body can run.

    Show the answer
    The condition is tested before the body is entered, and the body runs only while the condition holds, as in WHILE...ENDWHILE. Because the test comes first, the body may run zero times: if the condition is already False when the loop is reached, the body is skipped entirely.
  3. Relational Operations, Constants and Variables

    How do you test that a mark is at least 40 but no more than 69?

    Show the answer
    mark >= 40 AND mark <= 69. 'At least' maps to greater than or equal to, and 'no more than' maps to less than or equal to; using the strict < and > operators here would wrongly exclude the boundary values 40 and 69.
  4. Boolean operations

    How would you write a condition that is True when a number n is NOT between 10 and 20 inclusive?

    Show the answer
    Either NOT (n >= 10 AND n <= 20), or the equivalent form n < 10 OR n > 20. Note that the negation turns the AND into an OR and reverses each comparison; writing n < 10 AND n > 20 is a common error and can never be True.
  5. Random numbers and exception handling

    Why are the random numbers a program produces described as pseudo-random?

    Show the answer
    Because they are produced by a deterministic algorithm from a starting value called the seed, not by a genuinely unpredictable physical process. The sequence passes statistical tests for randomness and is unpredictable in practice, but it is entirely determined by the seed and will eventually repeat.
  6. Variable scope and stack frames

    A program has a global variable called total and a subroutine that declares a local variable also called total. Which one does the subroutine's code use?

    Show the answer
    The local one: within the subroutine the local declaration hides the global of the same name, so all references there are to the local, and the global keeps its old value untouched. This shadowing is a frequent source of confusion, and is a good reason to avoid reusing global names locally.
  7. Recursive techniques

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

    Show the answer
    It calls itself endlessly. Each call pushes another stack frame, memory is used up, and the program fails with a stack overflow rather than looping harmlessly for ever. This is the recursive equivalent of an infinite loop, and it is why the base case must be reachable from every general case.
  8. Classes, Objects, Inheritance and Polymorphism

    What is instantiation?

    Show the answer
    The process of creating an object from a class. Memory is allocated for the new object, a constructor is run to set up its initial attribute values, and a reference to the object is assigned to a reference variable of the class type, through which the object is then used.

The 13 subtopics

One subtopic is one session. Work down the list.

Subtopic What it covers Questions
Data types Recall questions on the integer, real, Boolean, character and string types, why each variable is declared with one, and why the character '7' is not the number 7. 19
Programming concepts and program structure Recall questions on the three combining principles of imperative languages, and on declaration, assignment, selection, iteration and subroutines as statement types. 17
Arithmetic operations Recall questions on real division against integer division, DIV and MOD, the type each operation returns, and the packing problems the remainder is used to solve. 15
Relational Operations, Constants and Variables Recall questions on the six relational operations and their symbols, the result they yield, and the distinction between assignment and comparison. 12
Boolean operations Recall questions on the NOT, AND, OR and XOR operations, how XOR differs from OR, evaluating them for given values, and writing compound conditions with them. 8
String-handling operations Recall questions on length, position, substring and concatenation, on where positions are counted from, and on converting between characters and their character codes. 19
Random numbers and exception handling Recall questions on pseudo-random generators and seeding, scaling a random real into a range, and the structure and purpose of an exception handler. 10
Subroutines, parameters and return values Recall questions on procedures against functions, formal and actual parameters, passing by value and by reference, and what a call does to the flow of control. 16
Variable scope and stack frames Recall questions on local and global variables, why locals are preferred, what happens when a local shadows a global, and how stack frames explain a local's lifetime. 15
Recursive techniques Recall questions on base and general cases, what happens when the base case is never reached, the part played by the call stack, and tracing recursive factorial and summation. 12
Programming paradigms and the procedural approach Recall questions on the procedural and object-oriented paradigms, stepwise refinement, single entry and exit points, and how a hierarchy chart is drawn. 12
Classes, Objects, Inheritance and Polymorphism Recall questions on classes, objects and instantiation, constructors, attributes and methods, encapsulation with getters and setters, inheritance and when to use it, overriding, and polymorphism. 15
Aggregation, Composition, Class Diagrams and Design Principles Recall questions on aggregation and composition, drawing classes, inheritance and the +, - and # symbols in class diagrams, abstract, virtual and static methods, and the object-oriented design principles. 19
Fundamentals of Programming is 189 of the 1,516 questions in the guide.Get the guide, £9

How the guide is worked

Answering a question from memory stores it far better than reading the answer again. The guide runs that as a fixed procedure on one subtopic at a time, about twenty minutes a session.

  1. Step 1 · Closed book

    Cover the answers. Work through one subtopic and write down what you can. Leave blanks where you have nothing.

  2. Step 2 · Open book

    Go back to the top. Read each printed answer and write it out in full, including the ones you had right.

  3. Step 3 · Closed book again

    Same questions, same order, from memory. The gap between pass one and pass three is the session result.

Read the full method, the return schedule and the research behind it.

Nearby topics

All 13 topics Guide overview

AQA A-Level Computer Science Active Recall Guide

Every topic, not just this one. 1,516 questions with their answers.

£9 GBP
Get the guide

Digital PDF, sent to the email address on your order.