Computer Science Mock Cards Flashcards
1a) Kofil uses his computer to record an audio file of himself playing his guitar.
Outline what happens when the computer converts the music into a file.
To convert from an analogue recording into digital data we sample the amplitude of the waves at regular intervals, and we store it in binary.
1b) Kofil increases the sample rate his computer is using to record his guitar.
Explain 2 effects this will have on Kofil’s recording.
1) The Digital Data will be better quality/Resemble the original.
2) The File Size will increase.
2a) Order the following from smallest to largest:
* GB
* bit
* PB
* byte
* nibble
* MB
bit, nibble, byte, MB, GB, PB
2b) Convert the decimal number 191 into an 8 bit binary number.
128 64 32 16 8 4 2 1
1 0 1 1 1 1 1 1
= 10111111
2c) Convert the hexadecimal number 3E into a decimal number. You must show your working.
3E
Find the Value of E:
E = 14
Now Convert 3 to Binary:
2 1
1 1
And Convert E(14) to Binary:
8 4 2 1
1 1 1 0
Merge both Binary Values together:
111110
Lastly Convert the Binary Value to Denary:
32 16 8 4 2 1
1 1 1 1 1 0
Add the Digits Together:
Answer: 32 + 16 + 8 + 4 + 2 = 62.
2di) Add together the following two 8 bit binary numbers. Express your response in an 8 bit binary form.
01101010 + 10010110
+ 01101010
10010110 =
100000000
Convert to an 8 bit binary number:
00000000.
2dii) Identify the problem this addition has created.
It caused an overflow.
3a) Complete a 2 place right shift on the binary number 11001011.
Remove last 2 Bits:
00110010
3b) Complete the truth table for the Boolean statement p = NOT (A AND B)
A B P False False True False True True True False True True True False
Remember: In test Both answers are TRUE.
4a) Johnny is writing a program to create usernames. The first process he has developed is shown in the flowchart in Fig. 1.
E.g. using the process in Fig. 1, Tom Ward’s user name would be TomWa.
State, the username for Rebecca Ellis.
RebEl
as it says (in Fig.1) reduce first name to first 3 letters
and reduce the surname to first 2 letters.
4b) Johnny has updated the process used to create usernames as follows:
* If the person is male, then their username is the last 3 letters of their surname and the first 2 letters of their first name.
What would be the username for a male called Fred Biscuit using this updated process
uitfr
4b) Write an algorithm for Johnny to output a username using the updated process.
Written in Pseudocode: INPUT firstName, surname, gender IF gender = 'male' THEN Username = RIGHT (surname, 3) \+ LEFT (firstName, 2) ELSE Username = LEFT (firstName, 3) \+ LEFT (surname, 3) ENDIF OUTPUT username
5i) Identify a data type that could be used to store the number of minutes in this array.
An integer
5ii) State why this data type is the most approptiate.
It is a whole number.
6a) Willow has created a hangman program that uses a file to store the words the program can select from. A sample of this data is shown in Fig. 3.
Crime Bait Fright Victory Nymph Loose - Fig. 3.
Show the stages of a bubble sort when applied to the date shown in Fig. 3.
Go through a pass and swap names if they aren't in ascending order: 1st Pass) B, C, F, V, N, L 2nd Pass) B, C, F, N, V, L 3rd Pass) B, C, F, N, L, V 4th Pass) B, C, F, L, N, V
Answer: Bait, Crime, Fright, Loose, Nymph, Victory.
6b) Show the stages of a binary search to find the word ‘zebra’ when applied to the data shown in Fig. 4.
Amber House Kick Moose Orange Range Tent Wind Zebra - Fig
Find the word in the middle:
Amber House Kick Moose ORANGE Range Tent Wind Zebra
Now get rid of all smaller values including Orange:
Range Tent Wind Zebra
Then find the word in the middle:
Range Tent WIND Zebra
Again get rid of all smaller values including Wind:
Answer: Zebra
Questions on the other side of the paper)
A doctor’s surgery stores hundreds of patient’s details on its computer network. The surgery is concerned about the security of its patient’s sensitive medical data.
Staff are already required to use strong passwords to protect systems. Explain, with reference to system security, 3 other ways that the surgery could protect the system.
- Firewalls it shields the computer from malicious network traffic.
- Anti Malware it detects and blocks viruses.
- User Access Level it restricts user access to some parts of the computer network.
A school has all of its computers in a local area network (LAN)
Explain two measures which the school will need to take to ensure the security of the network.
- Passwords they are the first defense against unauthorised access.
- Encryption it encodes data to make it hard to read.
Fig. 1. is a circuit diagram
Complete the truth table for (NOT p) AND q.
P Q (NOT p) AND q 0 0 0 1 0 0 0 1 0 1 1 1
The names of students are sorted into these boxes.
Complete the following diagram to show the stages an insertion sort would take to complete this task.
Rob Anna Huw Emma Patrice Iqbal
Complete this in ascending order:
1st Pass) Anna Rob Huw Emma Patrice Iqbal
2nd Pass) Anna Huw Rob Emma Patrice Iqbal
3rd Pass) Anna Emma Huw Rob Patrice Iqbal
4th Pass) Anna Emma Huw Patrice Rob Iqbal
Final Pass/Answer: Anna Emma Huw Iqbal Patrice Rob
The following names of students are stored in an array with the identifier studentnames.
studentnames - Rob Anna Huw Emma Patrice Iqbal
Describe the steps that a linear search would do to find Anna in student names.
Rob Anna Huw Emma Patrice Iqbal
1st Pass) Rob compared to Anna in ‘studentnames’ - not found
2nd Pass/Answer) Anna compared to Anna in ‘studentnames’ - found
State what is meant by the term metadata.
It is data that describes other data.
Give one example of metadata that could be stored alongside the logo.
Resolution
b) The following logo is stored as a bitmap image. Each box represents one pixel, with three different colours being used in the image.
Calculate the fewest number of bits that could be used to store the logo as a bitmap image. You must show your working.
Resolution/Colour Depth
90/3 = 30 = 11110
c) Give two ways that the file size of the image could be reduced.
1) Decrease image resolution
2) Compress File Format
Give two reasons why computer scientists use hexadecimal to represent numbers instead of binary.
1) Large Binary numbers can be written in a few digits.
2) It is easier to understand than Binary.
Convert the denary value 105 into an 8 bit binary number.
64 32 16 8 4 2 1
1 1 0 1 0 0 1
= 01101001
Convert the binary value 1110 0011 into hexadecimal.
8 4 2 1
1 1 1 0 = 14
8 4 2 1
0 0 1 1 = 3
Answer = E3
The ASCII code for the character J is the denary number 74.
Write the 8-bit binary number for the ASCII character J in the following boxes:
64 32 16 8 4 2 1
1 0 0 1 0 1 0
As an 8 bit binary number:
01001010
Give the hexadecimal number for the ASCII character K.
Show your working.
K in Denary: 75
Convert 75 into Binary:
64 32 16 8 4 2 1
1 0 0 1 0 1 1
Split the table in half:
4 2 1
1 0 0 = 4
8 4 2 1
1 0 1 1 = 11 =B
The Answer is: 4B
End of Test Paper.