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.