Professional Documents
Culture Documents
Instructions: In your answer booklet provided, write the letter that corresponds with the most
appropriate response for each of the following. Each question is worth one (1) mark.
1. An Assembly language is a
a. Low level programming language
b. Middle level programming language
c. High level programming language
d. Internet based programming language
5. ‘do while’ loop is useful when we want that statement within the loop must be executed.
a. Only Once
b. At Least Once
c. More than Once
d. None of the Mentioned
6. Which of the following will allow a program to loop with an exit decision that occurs after
processing.
a. do-then
b. do-when
c. do-until
d. do-while
1
8. Which structure is used to select the proper path out of two or more alternative path in a
flowchart?
a. Looping structure
b. Sequence structure
c. Iteration structure
d. Selection structure
1. You are using Python IDLE Shell, let x=8 and y=2. what would be the results of the
following expressions:
a. x % y
b. x + y * 3
c. x ** y
d. x / y
e. x // 6
ANSWER
a. 0
b. 14
c. 64
d. 4.0
e. 1
2. You are using Python IDLE shell. Let the variable num1 be “dog” and the variable num2 be
“cat”. Write the values returned by the following operations:
a. num1 + num2
b. “The “ + num1 + “ chases the“ + num2
c. num1 * 4
2
ANSWER
a. 'dogcat'
b. 'The dog chases thecat'
c. 'dogdogdogdog'
3. Write a Python program that prints (displays) your name, address and telephone number.
ANSWER
print("Kevin Doe")
print("Kingston")
print("999-999-9999")
Question 1
An employee’s total weekly pay equals the hourly wage multiplied by the total number of
regular hours plus any overtime pay if the hours worked exceed 40 hours. Overtime pay equals
the total overtime hours multiplied by 1.5 times the hourly wage. Draw a flowchart that takes as
inputs the hourly wage, total regular hours, and total overtime hours and displays an employee’s
total weekly pay.
ANSWER
3
Question 2
Draw a flowchart that takes the radius of a sphere (a real number) as input and outputs the
following menu options:
d. Sphere’s diameter
c. Circumference
v. Volume
4
Useful facts:
diameter = 2 * radius
circumference = diameter * 3.14
volume = 4/3.0 * PI * radius * radius * radius
ANSWER