GCSE Computer Science · 12 free flashcards
Programming fundamentals flashcards
The key ideas of programming fundamentals for GCSE Computer Science, as flashcards you can study with spaced repetition.
What you need to know
Programming fundamentals covers the core building blocks used to write and understand programs. Students must understand variables and constants, which store data during a program's execution. They need to know the main data types such as integer, real, Boolean, character and string, and how to use arithmetic, comparison and logical operators. Sequence, selection and iteration are the three fundamental programming constructs: sequence means instructions run in order, selection uses conditions to choose a path (if/else), and iteration repeats code using loops (for and while). Students should also understand how to write and call subprograms such as procedures and functions, the difference between local and global variables, and how to trace through code to predict outputs. Input and output statements, assignment, and understanding how programs handle data are all essential skills for this topic.
Programming fundamentals: 12 key flashcards
Card 1
What is a variable in programming?
A variable is a named memory location that stores a value which can change while the program runs.Card 2
What is the difference between a variable and a constant?
A constant holds a value that never changes during execution, whereas a variable can be updated at any point in the program.Card 3
Name five common data types used in programming.
Integer (whole numbers), real (decimals), Boolean (true/false), character (single symbol) and string (sequence of characters).Card 4
What are the three fundamental programming constructs?
Sequence (instructions in order), selection (choosing a path based on a condition) and iteration (repeating a block of code).Card 5
What is the difference between a FOR loop and a WHILE loop?
A FOR loop repeats a set number of times; a WHILE loop repeats as long as a condition remains true, so the number of repeats may be unknown.Card 6
What does an IF...ELSE statement do?
It is a selection statement: if a condition is true one block of code runs; otherwise the ELSE block runs instead.Card 7
What is the difference between a procedure and a function?
A function returns a value to the calling code; a procedure carries out a task but does not return a value.Card 8
What is the difference between a local and a global variable?
A local variable only exists inside the subprogram where it is declared; a global variable is accessible throughout the entire program.Card 9
What does the MOD operator do?
MOD returns the remainder after integer division, for example 17 MOD 5 gives 2.Card 10
What does the DIV operator do?
DIV performs integer division, discarding any remainder, for example 17 DIV 5 gives 3.Card 11
What is casting in programming?
Casting converts a value from one data type to another, for example converting the string '42' into the integer 42 so arithmetic can be performed on it.Card 12
What is a trace table used for?
A trace table is used to manually track the value of each variable step by step through code, helping to identify logic errors and predict the program's output.
Quick quiz
Question 1 of 3
Which of the following correctly describes a WHILE loop?
Common mistakes
- Many students confuse the assignment operator (=) with the equality comparison operator (==), writing conditions such as if x = 5 when they mean to test whether x equals 5.
- Students often believe that a global variable is always better than a local one, when in fact using local variables inside subprograms is considered good practice because it reduces unintended side effects.
- A common error in trace table questions is forgetting to update every affected variable at each step, leading to incorrect final values and losing marks for otherwise correct working.
More GCSE Computer Science flashcards
Planning your revision? Read how to revise GCSE Computer Science, or make cards from your own notes with the notes to flashcards tool.
Written for general GCSE revision. Exam boards and schools differ, so check your own specification for exactly what you need to know. Lerno is not affiliated with any exam board.