AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
String conversion operations.
Full specification wording
String handling operations in a programming language: string conversion operations.
String conversion operations change a value from one data type to a string, or change a string into another type.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 7 of 11
Study notes
From the checked teaching notes for this specification point.
The idea
String conversion operations change a value from one data type to a string, or change a string into another type. In AQA 8525 you meet conversions such as turning an integer into text so it can be joined to other text, and turning a string of digits into an integer so arithmetic can be performed. For example, in Python str(42) gives the string "42", and int("42") gives the integer 42. A conversion does not change the characters themselves; it changes the data type the program treats the value as. Learners should recognise which operation is needed for a given task, predict the resulting type, and understand that joining text to a number usually requires converting the number first.
What earns the marks
- Identifies that a string conversion operation changes a value's data type to or from string.
- Recognises an example such as converting an integer to a string so it can be concatenated with text.
- Distinguishes conversion from concatenation: conversion changes type, concatenation joins strings.
- Predicts the data type produced by a given conversion, for example that converting a number to a string yields text.
- Explains that converting a string of digits to a number allows arithmetic to be carried out.
Common mistakes and how to put them right
Confusing conversion with concatenation.
Put it right: Is that conversion changes the data type while concatenation joins two strings together.
Assuming a number stored as text can be added arithmetically without conversion.
Put it right: Is that it must first be converted to an integer or real.
Thinking conversion alters the characters themselves.
Put it right: Is that the characters stay the same but the data type changes.
Exam tips
- Read the question to identify the required input and output data types before choosing an operation.
- Remember that joining text to a number usually needs the number converted to a string first.
- Check whether the task needs arithmetic (convert to number) or display/joining (convert to string).
Try the lesson
The start of the String handling operations in a programming language: string conversion operations. lesson, made from checked teaching notes for this specification point.
Have a go first
A program stores the number 42 in a variable called score. Which operation produces the string value "42" so it can be joined onto other text?
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of String handling operations in a programming language: string conversion operations.
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge