Question 2

OCR Computer Science June 2019 Paper 1AS9 marks

On the specification

(a)
1.4 Data types, data structures and algorithms
(b)
1.4 Data types, data structures and algorithms
(c)
1.4 Data types, data structures and algorithms
(d)
1.4 Data types, data structures and algorithms
Question text

2 Variables in programs contain specific types of data. (a) Complete the table below to suggest a suitable data type for each piece of data. Data Data Type ‘H’ Character “Hello” 35 −2.625 Real True [3] (b) Show the denary number 35 as an 8-bit (unsigned) binary number. [1] (c) The character ‘A’ in the ASCII character set is represented by the denary value 65. Write the binary representation for the ASCII character ‘H’. Show your working. [2] (d) Show the denary number −2⅝ as a floating-point binary number with a 6-bit mantissa and 4-bit exponent, both stored using two’s complement representation. [3]