You are on page 1of 5

SECTION A (COMPULSORY – 10 Marks)

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

2. Which of the following is not an example of a Procedure-Oriented Language?


a. Fortran
b. Pascal
c. C
d. Smalltalk

3. Terminal symbol in a flowchart indicates


a. End
b. Processing
c. Input and Output
d. Decision

4. Which of the following is not a principle of good programming style?


a. Use descriptive variable names
b. Provide a welcome message
c. Do not write the whole program at once
d. Test the program

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

7. What symbol is used to represent output in a flowchart?


a. Square
b. Circle
c. Parallelogram
d. Triangle

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

9. An identifier in Python cannot start with?


a. A number
b. An alphabet
c. An underscore
d. A capital character

10. Which of the following statements is wrong in Python?


a. int=123
b. value=’ ‘+5
c. lime=20*’T’
d. count=5+result

SECTION B - COMPULSORY QUESTIONS – 20 marks


ALL questions within this section must be answered. Each question is worth 5 marks.

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")

4. Which of the following are valid variable names in Python?


a. Length
b. _width
c. firstBase
d. 2MoreToGo
e. halt!
ANSWER
Valid are a,b,c

SECTION C (LONG QUESTIONS – 20 Marks)


Answer ONE (1) question from this section. Each question is worth 15 marks.

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

You might also like