Fundamentals of programming — AQA A-Level Computer Science
Test yourself on Fundamentals of programming with AQA A-Level practice questions.
7 days Premium · Then free forever · No card, no charge
Fundamentals of programming explained
This topic covers the fundamental principles of imperative programming, including data types, control structures, and subroutines.
Read the full explanation
It emphasizes the structured approach to program design, the use of meaningful identifiers, and the application of arithmetic, relational, and Boolean operations to solve computational problems.
What to demonstrate
- Correct use of programming constructs: sequence, selection, and iteration.
- Appropriate declaration and use of variables and constants.
- Correct implementation of subroutines (procedures/functions) with parameters and return values.
Show all 10 objectives
- Effective use of local and global variables.
- Correct application of arithmetic, relational, and Boolean operators.
- Accurate string manipulation and type conversion.
- Correct use of arrays and records.
- Implementation of exception handling.
- Use of random number generation.
- Understanding of structured programming principles and hierarchy charts.
Fundamentals of programming exam tips
Quick Revision Summary (Key Takeaway)
Fundamentals of programming covers the core constructs of programming: variables, constants, data types, sequence, selection, iteration, and subroutines. It also introduces key concepts like arrays, records, file handling, and the use of IDEs, forming the foundation for all programming tasks in AQA A-Level Computer Science.
Topic Overview
Fundamentals of programming is the bedrock of computer science. It introduces the essential building blocks that allow you to write instructions for a computer to follow. You will learn about variables and constants, which store data, and the different data types such as integer, real, char, string, and Boolean. Understanding how to manipulate these using operators is crucial for any program.
The topic also covers the three core control structures: sequence, selection, and iteration. Sequence is the order in which statements execute, selection uses IF and CASE statements to make decisions, and iteration uses loops (FOR, WHILE, REPEAT UNTIL) to repeat blocks of code. These structures are universal across programming languages, so mastering them here will help you in any language you encounter.
Additionally, you will explore subroutines (procedures and functions), which allow you to break down complex problems into manageable chunks. You'll learn about parameters, return values, and the scope of variables. This modular approach is essential for writing maintainable and efficient code. Finally, you'll be introduced to data structures like arrays and records, and file handling, which are vital for storing and organising data. This topic forms the foundation for all other programming topics in the A-Level, including object-oriented programming and algorithms.
Key Concepts
- →Variables and constants: named memory locations that store data; constants do not change value.
- →Data types: integer, real, char, string, Boolean, and their appropriate uses.
- →Control structures: sequence, selection (IF, CASE), and iteration (FOR, WHILE, REPEAT UNTIL).
- →Subroutines: procedures and functions, with parameters and return values.
- →Arrays and records: storing collections of data; arrays use indices, records use fields.
Marking Points
- Correct use of programming constructs: sequence, selection, and iteration.
- Appropriate declaration and use of variables and constants.
- Correct implementation of subroutines (procedures/functions) with parameters and return values.
- Effective use of local and global variables.
- Correct application of arithmetic, relational, and Boolean operators.
- Accurate string manipulation and type conversion.
- Correct use of arrays and records.
- Implementation of exception handling.
- Use of random number generation.
- Understanding of structured programming principles and hierarchy charts.
Examiner Tips
- 💡Ensure you are familiar with the specific syntax of your chosen programming language (C#, Java, Python, or VB.Net).
- 💡Practice hand-tracing algorithms to ensure logic is correct before writing code.
- 💡Always use meaningful variable names to improve code readability.
- 💡When designing solutions, use hierarchy charts to plan the modular structure.
- 💡Be prepared to write, adapt, or extend programs provided in the skeleton code.
- 💡Always use the correct terminology: 'identifier', 'assignment', 'condition', 'iteration' – this shows the examiner you understand the concepts.
- 💡When writing pseudocode, keep it consistent with AQA's pseudocode style – use indentation and clear keywords like IF, THEN, ELSE, ENDIF, FOR, WHILE, etc.
- 💡For 6-mark questions, plan your answer: state the data structures needed, outline the algorithm, and then write the code. This ensures you cover all marks.
Common Mistakes
- Confusing local and global variable scope.
- Incorrect use of definite vs indefinite iteration.
- Failure to use meaningful identifier names.
- Misunderstanding the difference between integer and real division.
- Incorrect handling of array indices (e.g., off-by-one errors).
- Poor documentation or lack of modular structure in code.
- Misconception: A WHILE loop always executes at least once. Correction: A WHILE loop checks the condition before the first iteration, so it may execute zero times if the condition is initially false.
- Misconception: A variable declared inside a subroutine is accessible everywhere in the program. Correction: It is local to that subroutine and cannot be accessed outside it.
- Misconception: A function and a procedure are the same. Correction: A function returns a value, while a procedure does not.
Revision Plan
- 1Week 1: Focus on variables, constants, data types, and operators. Practice writing simple programs that declare variables and perform calculations.
- 2Week 2: Move to selection and iteration. Write programs that use IF statements and loops to solve problems like finding the largest number in a list.
- 3Week 3: Study subroutines, parameters, and scope. Convert existing programs into modular versions using procedures and functions.
- 4Week 4: Cover arrays, records, and file handling. Practice reading from and writing to files, and manipulating arrays.
- 5Week 5: Attempt past paper questions, especially 6-mark programming questions. Review mark schemes to understand how marks are awarded.
Exam Question Types
- 📋Multiple-choice questions on data types and control structures – read carefully for keywords like 'always' or 'never'.
- 📋Short-answer questions asking to define terms like 'variable' or 'subroutine' – give precise definitions with examples.
- 📋Pseudocode writing tasks – follow AQA pseudocode conventions exactly.
- 📋6-mark extended questions that require designing and writing a program to solve a problem – plan your answer and include comments.
Command Word Expectations (AQA)
Give the precise meaning of a term. No examples needed, but a clear, concise definition is required.
Give a detailed account of how or why something works. Include reasons and causes, not just a description.
Produce a program or pseudocode that solves the given problem. Marks are awarded for correct syntax, logic, and use of appropriate constructs.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: A program stores the daily temperatures for a week in an array. Write pseudocode to calculate and output the average temperature. The array is called temperatures and contains 7 real numbers.
- 1.Step 1: Initialise a variable total to 0.
- 2.Step 2: Use a FOR loop to iterate from index 0 to 6, adding each element to total.
- 3.Step 3: After the loop, calculate average by dividing total by 7.
- 4.Step 4: Output the average.
Question: Explain the difference between a parameter and an argument in a subroutine, and give an example of each.
- 1.Step 1: Define a parameter as a variable in the subroutine definition.
- 2.Step 2: Define an argument as the actual value passed when the subroutine is called.
- 3.Step 3: Provide a concrete example: SUBROUTINE add(a, b) – here a and b are parameters; calling add(3, 5) passes 3 and 5 as arguments.