Level:
Correct: 0
Incorrect: 0
Marks: 0/0
Exam Practice
Course:
Topics:
AQA GCSE Computer Science (Paper 1) Smart practice A mixed round aimed at your weak spots
Unit 1
3.1 Fundamentals of algorithms
Unit 2
3.2 Programming
Data types
Data types
Arithmetic operations in a programming language
Arithmetic operations, DIV and MOD
Relational operations in a programming language
Relational operations
Boolean operations in a programming language
Boolean operations in conditions
Data structures
Arrays and records
Input/output
Input and output
String handling operations in a programming language
String handling
Random number generation in a programming language
Random number generation
Structured programming and subroutines (procedures and functions)
Subroutines and structured programming
Avg
score:
–
Topics
done:
0/15

Data types

Practise 25 exam-style questions on Data types for AQA GCSE Computer Science (Paper 1). Write your answer as you would in the exam and get it marked in seconds against the mark scheme, point by point, with the Study Helper on hand if you get stuck.

  • 25 questions
  • 1–6 marks each
  • Instant marking
  • No sign-up needed
20 questions, marked as you go

Sample questions with model answers

Here are 4 of the questions in this topic, each with a model answer, an explanation of why it earns the marks and the mark scheme an examiner would use.

Question 1

1 mark

Which one of the following values has the real data type?

Choose your answer.

  • 15
  • '15.0'
  • 15.0
  • 'fifteen'

Model answer

15.0

Explanation

15.0 is a number written with a fractional part, so it is a real, even though the fractional part is zero. 15 is an integer, and '15.0' and 'fifteen' are strings because they are in quotation marks. The common mistake is to choose '15.0' without noticing the quotation marks.

Mark scheme
  1. 1 mark

    15.0

    Mark is for AO1 (understanding). If more than one option is given, 0 marks.

Question 2

2 marks

A school's contacts program stores parents' mobile phone numbers, such as 07700 900123

Explain why the phone number should be stored using the string data type rather than the integer data type.

Model answer

If it were stored as an integer, the leading 0 would be lost, so 07700 900123 would become 7700900123. The number also contains a space, which an integer cannot hold, and no calculations are ever done with a phone number.

Explanation

Data made of digits is not always a number: a phone number is an identifier, not a quantity. Storing it as an integer would drop the leading zero and could not include the space. Since phone numbers are never added or multiplied, string is the suitable type.

Mark scheme
  1. 1 mark

    An integer would lose the leading zero // 07700 900123 would be stored as 7700900123

    2 marks for AO2 (apply). Max 2 from the three points. I. True but irrelevant statements about phone numbers in general.

  2. 1 mark

    The phone number contains a space / could contain other characters such as + or brackets, which an integer cannot store

  3. 1 mark

    No calculations / arithmetic will be done with a phone number // a phone number is an identifier, not a quantity

    A. an 11-digit number may be too large for the standard integer type in some languages (e.g. above the limit of a 32-bit int in C# or VB.NET). Do not award two marks for the same idea expressed twice.

Question 3

3 marks

The pseudo-code below is the start of a program for booking seats at a cinema. The variable seatRow will always hold exactly one letter.

CONSTANT SEAT_PRICE ← 7.25
seatRow ← 'F'
seatNumber ← 12
isBooked ← False
customerName ← 'Ellis'

State the most suitable data type for each of the following:
- SEAT_PRICE
- seatRow
- isBooked

Model answer

SEAT_PRICE: real
seatRow: character
isBooked: Boolean

Explanation

7.25 has a fractional part, so SEAT_PRICE is a real (a constant still has a data type). 'F' is a single letter, so character is the most suitable type, and False is a Boolean value - it has no quotation marks, so it is not the string 'False'. seatNumber (an integer) and customerName (a string) are not asked for.

Mark scheme
  1. 1 mark

    SEAT_PRICE: real // float // double // decimal

    All marks AO2 (apply). I. Case. A. language-specific names for a real type, e.g. Single (VB.NET). R. integer.

  2. 1 mark

    seatRow: character // char

    R. string (the question says seatRow always holds exactly one letter, so character is the most suitable type).

  3. 1 mark

    isBooked: Boolean // bool

    R. string (False has no quotation marks, so it is the Boolean value, not the string 'False').

Question 4

4 marks

A school is writing a program to record the results of sports day races. The table in the figure shows four items of data that the program will store, with an example of each.

State the most suitable data type for each item, P, Q, R and S.

Sports day data. Table with columns "Data item", "Example", "Data type". Data item: Number of runners in the race; Example: 8; Data type: P | Data item: Winning time in seconds; Example: 13.42; Data type: Q | Data item: Whether the school record was broken; Example: Yes or No; Data type: R | Data item: Winner's house (one letter); Example: G; Data type: S.

Model answer

P: integer
Q: real
R: Boolean
S: character

Explanation

A count of runners is always a whole number (integer), while a time to two decimal places has a fractional part (real). The record is either broken or not, so a Boolean (True or False) is best, even though it is described as Yes or No. A single letter is a character; a common mistake is to answer string for S.

Mark scheme
  1. 1 mark

    P: integer

    All marks AO2 (apply). I. Case. A. language-specific names, e.g. int, float, double, bool, char.

  2. 1 mark

    Q: real

    A. float / double / decimal. R. integer.

  3. 1 mark

    R: Boolean

    R. string (there are only two possible values).

  4. 1 mark

    S: character

    A. char. R. string (only one letter is stored).

Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.

Study Helper Hints first, answers after you try

Stuck on this one? Ask for a hint and I’ll point you in the right direction, without giving the answer away. Once you’ve checked your answer, I’ll show you how the marks are awarded.