CWSS 2020 Computing P2
CWSS 2020 Computing P2
COMPUTING
Paper 2 (Practical)
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.
Task 1
A delivery company is trying to incentivise its delivery staff to work harder amidst the
spread of the COVID-19 virus. It uses spreadsheet to track the staff’s trips and amount of
money they clocked in their deliveries for a particular week.
Open the file WEEKLY. You will see the following data.
1 The first letter of the Employee ID states the area that he/she is deployed to work
in. Enter an appropriate function in the Area column to find the area that the
employee is deployed to. [1]
2 Use an appropriate function to search for the Incentive in the Incentive Table,
complete the Incentive column. [2]
3 Enter a formula in the Commission column to calculate the commission that each
staff gets. The commission is calculated by multiplying the incentive to the amount
clocked. [1]
4 Use a conditional statement, to identify those staff who have commission more than
$75.00 and put YES in the Award column. Otherwise, put NO in the Award column.
[2]
5 Use conditional formatting, to identify those staff who have commission less than
$20 by highlighting the cells in the Commission column in red. [2]
6 Use an appropriate function to count the number of staff deployed in each area and
put the number in the Number of Staff column in the Staff Deployment table. [2]
Task 2
The following program takes in 2 user entries and verifies if the users are Singaporeans by
checking if the first letter of each entry is “S”. If the user is a Singaporean, the program
prints a welcome home message. Otherwise, it prints a welcome to Singapore message.
ID = ''
for i in range(2):
ID = input("Enter ID: ")
if ID[0] == "S":
print("Welcome home!")
else:
print("Welcome to Singapore!")
(ii) It prints the same welcome home message if the first letter of the entry is
either “S” or “T”. [2]
(iii) The program counts the total number of Singaporeans in the list. [3]
Task 3
The following program accepts a user-defined string, removes the spaces, and extracts the
characters based on the indices specified by the user.
For example, if the string is “I have a cat” and the indices entered are 2,3,6,8, the program
prints the output of ‘avct’.
There are several syntax errors and logical errors in the program.
new_string = ''
final_string = ''
for j in range(string):
if string[j] == '':
break
else:
new_string = new_string + string[j]
for i in range(len(indx_lst)):
indx_lst[i] = indx_lst[i]
9 Identify and correct the errors in the program so that it works correctly accordingly
to the rules above. [10]
Task 4
You have been asked to write a program to convert the raw marks of four subjects
(English, Mother Tongue, Mathematics and Science) into grades.
Number of Distinctions: 2
Number of Credits: 5
Number of Passes: 3
Number of Failures: 2
Extend your program such that the user can input and vary the distinction, credit
and passing mark.
Include in your program to validate that the distinction mark to be higher than the
the other two marks, and the credit mark to be higher than the passing mark.
END OF PAPER