Professional Documents
Culture Documents
M150A
Data, Computing and Information
Mock MTA
Date: ..
Number of Exam Pages:
( )
Time Allowed: ( 1.5 ) Hours
(including this cover sheet)
Instructions:
Instructions:
1.
2.
3.
4.
5.
. .1
.
.2
.
.3
.
. .4
.5
.
Page 1 of 8
a computer program that transfers each character in a scanned text into a digital code.
an array of sensors inside a digital camera or scanner.
a type of monitor.
a removable storage media device.
Page 2 of 8
Page 3 of 8
1. Show all the steps required to convert the decimal value 365 to its binary representation. (4 Marks)
2. Consider a one-hour documentary film to be displayed on a TV at 30 fps. Each frame is 750 x 420 pixels and a
24-bit RGB color encoding is being used. How many bytes will be required to represent the whole film? (6
Marks)
3. Given the following selection structure example: (10 Marks)
if ( ( Employee Salary < 600) or ( not ( Employee Title = Manager ) ) )
Employee gets a promotion
else
Employee doesnt get a promotion
1. Complete the Following truth table for the Boolean expression in the above example.
Employee Salary < 600
Employee Title =
Manager
2. Examine the following employees salaries and grades & decide whether they will get a promotion
or not.
a. Employee 1: Salary 500, Title = Supervisor.
b.
Page 4 of 8
4. The following diagram shows some instructions involving a loop: (10 Marks)
Set x to 2
false
(x<=100 )
true
1. Identify.
a. The condition.
b. The loop body.
c. Any instructions that are not in the loop body, and so are not repeated.
2. How many times will the loop body be executed?
3. What is the output after these instructions have been followed? You should draw a tracing table.
Page 5 of 8
Answer Key
Part1: Multiple choices (12 marks)
Question #
Answer
Page 6 of 8
1. (4 marks)
(365) 10 = (101101101) 2. (Students should show the calculations to get the mark)
2. (6 marks)
# pixels in each frame = 750 * 420 = 315000 pixels
# of bytes in each frame = 315000 * 3 = 945000 bytes
# of seconds in the movie = 1 * 60 * 60 = 3600 seconds
# of frames in the movie = 3600 * 30 = 108000 frames
# of bytes in whole movie = 108000 * 945000 = 102060000000 bytes
3. (10 marks)
a. The truth table:
Employee
Employee Title =
Manager
Manager)
b.
Employee1: gets a promotion
Employee2: gets a promotion
Employee3: doesnt get a promotion
Employee4: doesnt get a promotion
Page 7 of 8
4. (10 marks)
1.
a. The condition: x<=100
b. The loop body:
Multiply x by 3
Set x to 2
(x<=100)
2
6
18
54
108
True
True
True
True
False
Go into
the
loop??
Yes
Yes
Yes
Yes
No
(Stop)
Iteration
number
1
2
3
4
Page 8 of 8
output
2
6
18
54
Done