MSHS 2019 P2
MSHS 2019 P2
MSHS 2019 P2
/ /
COMPUTING 7155/02
Paper 2 (Lab-based) 29 Aug 2019
2 hours 30 minutes
Additional Materials:
Electronic version of BANK.XLSX data file
Electronic version of WEIGHT.PY file
Electronic version of RIDE.PY file
Insert Quick Reference Glossary
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.
50
Maybey Bank uses spreadsheet software to record its customers’ loan records. You
are required to finish setting up the spreadsheet to record the details.
Open the file BANK.XLSX. You will see the following data.
1 For the cell range B5:B16, use an appropriate function to extract the first letter of
the Customer Code to represent the Account Type.
[1]
2 Use an appropriate function to search for the Number of Years in the Loan Plan
Term Table given and use it to complete the Number of Years in Loan Plan
column.
[2]
3 Use an appropriate function to search for the Interest Rate per Annum in the
Interest Rate Table given and use it to complete the Interest Rate per Year
column.
[2]
4 Enter a formula to calculate the total amount of money each customer will have to
pay at the end of their loan plan period. This is based on the Number of Years in
Loan Plan, Interest Rate per Year compounded monthly and Loan Amount.
Use that value to complete the Total Amount of Pay column
[3]
5 Use a conditional statement, to identify those customers who have taken a loan
amount of more than $45000 and whose application method was online, and put
YES in the Free $70 Cash-back column. Otherwise, put NO in the Free $70
Cash-back column.
[2]
Save and close your file.
Task 2
3
The following program accepts the weight in kg for 15 students and prints out the
highest weight and the average weight of the students. The weights are in the range of
20kg to 140kg (inclusive).
heaviest = 20
total_weight = 0
no_of_students = 15
(b) Prints out the lightest weight as well as the heaviest weight. [4]
(c) Test if the weight input is between 20kg and 140kg (inclusive), and if not, asks
the user for input again as necessary.
[3]
Save your program.
Edit your program so that it works for any number of students. [2]
You can assume that all entries will be in the format age,height(in cm)
There are several syntax errors and logical errors in the program.
customer = 1
data = input (("Enter details of customers: ")
date=data.split(",")
age = int(data[1])
height = int(data[0])
else:
print("Entry allowed. Please enjoy your ride.")
customer = customer + 1
if customer == 5:
break
print("Please check safety belts of customers and get ready to start ride."
8 Identify and correct the errors in the program so that it works correctly according
to the rules above.
[10]
Save your program.
5
Task 4
You have been asked to write a program to verify the check digit of the Singapore NRIC
number. The last letter at the end of the NRIC number is called a checksum. The
checksum allows us to check if the NRIC number has been entered correctly.
(1 x 2) + (2 x 7) + (3 x 6) + (4 x 5) + (5 x 4) + (6 x 3) + (7 x 2) = 106
• If the first letter of the NRIC starts with T or G, add 4 to the total.
• Then you divide the number by 11 and get the remainder.
106/11 = 9 remainder 7
• The letter you get depends on the first letter in the IC using the code below:
S9374728J
T0005923J
G7730493R
-End of Paper-