Exam tip 1
In your Paper 2 exam, you MUST declare all variables you use. A common mistake is to forget declarations, which will lose you marks. Also, be very careful to use for assignment and for comparison. Mixing these up is a frequent error.
9618 · 11.1
Common exam mistakes on 9618 Programming Basics. Learn what loses marks, then practise the topic with Examiner’s Ink.
In your Paper 2 exam, you MUST declare all variables you use. A common mistake is to forget declarations, which will lose you marks. Also, be very careful to use for assignment and for comparison. Mixing these up is a frequent error.
When a question gives you a scenario, read it carefully to identify all the data that needs to be stored. For each piece of data, ask yourself: 'Can this value change?' (Variable vs Constant) and 'What kind of data is it?' (INTEGER, REAL, STRING etc.). This will help you structure your declarations correctly.
Using a constant for a value that should not change makes your code safer and more readable. It prevents accidental changes to the value elsewhere in the program. It also makes maintenance easier; if a value like a tax rate changes, you only need to update it in one place (the constant declaration) rather than searching for it throughout your code.
Conceptually, a CHAR is for a single character, like 'A', while a STRING is for a sequence of characters, like "Hello". A STRING can have a length of 1, e.g., "A". In many programming languages and in exam pseudocode, they are treated differently. A CHAR variable cannot hold a STRING value, and vice-versa. Always choose the type that best represents the data's purpose.
In Cambridge pseudocode, it is standard practice and highly recommended to declare all variables and constants at the beginning of the program or sub-program. This improves readability and helps you plan your program structure before you start writing the logic. Sticking to this convention will earn you marks for clarity and good programming practice.
Yes, you can. is a valid assignment. However, the value is stored as text, not as a number. You cannot perform mathematical calculations on it directly (e.g., "123" + 1 is an error). You would need to convert the string to an integer first. This is why choosing the correct data type is so important.