You are on page 1of 4

Sample Past Paper Questions

Question 1 [20 Marks]


a) Explain the term ‘Algorithm’. [2 Marks]

b) What are the 2 methods which we can use to represent an algorithm? [2 Marks]

c) Consider the below flowchart to answer the questions.

(i) Which of the following is correct regarding the above flowchart? [1 Marks]
a) It repeats more than three times.
b) It stops when 3 is entered for num.
c) It displays the total when the count is 3.
d) It gets 4 numbers from a user.
(ii) Write a suitable formula, which can be used to replace “Add num to total” in the
flowchart? [1 Marks]
(iii) Mention the suitable operator type and the name of the operator we can use for the
condition in the above flow chart. [2 Marks]
(iv) Write 2 advantages of using flowcharts. [2 Marks]
Question 2 [20 Marks]

a) What is a List in Python? Explain with an example. [3 Marks]


b) For what purpose Lists are used in Python? [2 Marks]
c) What is the difference between ‘Append’ and ‘Insert’ methods related to Lists in Python? [5 Marks]
d) A canteen of a university sells 10 different types of foods. These food types are placed in a shelf.
Students can select foods while walking alongside the shelf and keep them in a tray. These trays are
available at the entrance of the canteen. A student, after selecting the food, should proceed to the
cashier with the food tray for the payment.

You are asked to write a python program to calculate the payment due for a food tray. For this purpose,
each food type is given a unique integer from 0 to 9.
The integer value assigned to each food type and its unit price is shown in the following table.

Food Type 0 1 2 3 4 5 6 7 8 9
Unit Price Rs. 10.00 12.00 15.00 10.00 25.00 45.00 50.00 25.00 10.00 12.00

i) State all the inputs required for the computer program and its expected output. [3 Marks]
ii) write a python program to calculate the payment due for a food tray [7 Marks]
Question 3 [10 Marks]
The following algorithm is to find the sum and average of given series of numbers.
Complete the algorithm by dragging and dropping the labels to relevant blank labels from the list
given below.

Step-1 Start
Step-2 ___________________
Step-3 SUM=0
Step-4 ___________________
Step-5 ___________________
Step-6 COUNT=COUNT+1
Step-7 IF More Numbers in the Series, then
Step-8 ___________________
Step-9 ELSE
Step-10 ___________________
Step-11 DISPLAY SUM, AVERAGE
Step-12 Stop

AVERGAE= COUNT / SUM COUNT = 2 GOTO Step - 4 COUNT = 0 SUM = SUM + NUM

GOTO Step -12 INPUT NUM = SUM + SUM AVERGAE=SUM / COUNT INPUT NUM
COUNT
Question 4 [10 Marks]

Answer the questions based on the Python code below.


Output of the program is,

Select the correct answer and drag and drop to the correct space.
Hint – Look at the star pattern, it only displays stars for odd number patterns!

1. count=10
2. _________
3. for i in range (count):
4. if (_________):
5. _________
6. else:
7. for x in range (i):
8. _______________
9. _______

count += 1 star = "*" continue count = 10 elif: print (star,end="") print()


print (star) break i % 2 == 0 i % 2 == 1

You might also like