SQSS 2018 P2
SQSS 2018 P2
2 hours 30 minutes
All tasks must be done in the computer laboratory. You are not allowed to bring in or take out
any pieces of work or materials on paper or electronic media or in any other form.
The number of marks is given in brackets [ ] at the end of each question or part question.
The total number of marks for this paper is 50.
Total 50
Open the file LIBRARY. You will see the following data.
Save the file as MYLIBRARY_<your name>_<centre number>_<index number>.
2 The second to fifth digits of the Borrower ID indicates the date of birth
of the borrower. For example, Borrower ID F19900762 indicates that
the date of birth of the borrower is 1990.
Enter a formula to calculate the age of the borrower and use it to
complete the Age column. [2]
3 Use an appropriate function to search for the Item Type in the Loan
Type table and use it to complete the Due Date column in the
Borrowers List table. [2]
highest_rainfall=0
for day in range(7):
rainfall = int(input("Enter rainfall recorded in mm: "))
if rainfall > highest_rainfall :
highest_rainfall = rainfall
print("Highest rainfall recorded for the week is ",
highest_rainfall)
9 Identify and correct the errors in the program so that it works correctly
according to the rules above. [10]
• Prompt user to enter the marks for each student in the format a, b,
c, d, where a is the mark for English, b is the mark for Mother
Tongue, c is the mark for Math and d is the mark for Science.
An example is 67,78,81,75
• The marks entered must be an integer from 0 to 100. Program will
terminate when there is an invalid input.
• After the students’ marks are entered, the program will then
calculate and print each student’s average mark for the four
subjects. The average mark must be rounded to the nearest
integer.
11 When your program is working, use the following test data to show
your text results:
67,78,81,75
54,67,48,59
89,92,87,91
42,62,42,45
END OF PAPER