cs paper 1 Flashcards
(342 cards)
What type of data type should be used to store a phone number like 07886756443 and why?
string - numeric types would remove the the leading 0
Perform an AND mask on the binary numbers: 1010 1101 0101 1011
1001
What data type stores a collection of characters?
string
Add the two binary number: 0101 1011 0011 1010 Give answer in decimel
149
What is the decimal 45 in binary? Give answer as a byte
0010 1101
What is the hexadecimal number 2E in decimal?
46
What is the hexadecimal 45 in binary? Give answer as a byte
0100 0101
Which data type stores True and False?
boolean
What is -5 in sign and magnitude binary? Give answer as a nybble
1101
What does the binary 0110 1100 represent in hexadecimal?
6C
What is the effect of a logical shift left by one place on a binary number?
the value doubles
What is the two’s compliment binary 1010 1101 in decimal?
-83
The binary 001101000 0110 is a floating point number with a single-bit sign, 8-bit mantissa and 4-bit exponent. What is the number in decimal?
26
Perform a logical shift right by two places on the binary number 0110 1010 and convert result to decimal.
26.5
Perform an XOR mask on the binary numbers: 0101 0101 1011 1011
11101110
Which of the following is not a character? a. ‘8’ b. R c. % d. 43
43
The binary 110011000 0011 is a floating point numer with a single-sign, 8-bit mantissa and 4-bit exponent. What is the number in decimal?
-3.25
What is an array?
an ordered, finite set of elements of the same type
What type of array is a linear array?
a one-dimensional array
How can you visualise a two-dimensional array?
as a spreadsheet or table
How can you visualise a three dimensional array?
as a multi-page spreadsheet
What is a record also known as?
a row in a file
What is a record made up of?
fields
How can you select a field from a record using pseudocode?
recordName.FieldName