ACSBR 2020 Computing P2 Solution
ACSBR 2020 Computing P2 Solution
COMPUTING
PRELIMINARY EXAMINATION
Solution Paper 2
Task 1
ORDERS_sample - Formula view
=IF(C3="Luxury",0.2,IF(C3="Deluxe",0.1,IF(C3="Classic",0)))*D3
=D3+E3
4 One mark for multiplying Loan% to get the Loan amount [1]
=F3*G3
=VLOOKUP(I3,A$33:C$36,3,TRUE)
=-PMT(J3/12,I3*12,H3,0)
=COUNTIF($B3:$B22,B26)
MYBMI
students = 15
upp_bound = 25
low_bound = 18.5
underwt, overwt = 0, 0
MYBMI2
students = int(input("Enter number of students "))
upp_bound = 25
low_bound = 18.5
underwt, overwt = 0, 0
MYMARKS
nlist = ["Alden", "Belle", "Charles", "Dolly", "Elle", "Falken", "Grace",
"Hacken"]
mlist = [56, 64, 23, 78, 53, 46, 98, 33]
items = len(nlist)
num = 0
name_found = False
while name_found == False:
while num < items:
if nlist[num] == to_find:
print("{} score {} for the test".format(nlist[num], mlist[num]))
name_found = True
num = items
elif num == items - 1:
print("{} is not in the list".format(to_find))
name_found = True
num = items
else:
num += 1
TPSTAFF
no_staff = 5
staff_list = []
time_in = []
time_out = []
work_time = []
wage = []
for i in range(no_staff):
staff = input("Enter name of staff: ")
staff_list += [staff]
tin = input("Time-in HH:MM for {}: ".format(staff))
while not (tin[:2].isdigit() and tin[2] == ":" and tin[-
2:].isdigit()\
and len(tin) == 5 and 0 <= int(tin[:2]) <= 23 and 0 <=
int(tin[-2:]) <= 59):
tin = input("Invalid! Time-in HH:MM for {}:
".format(staff))
time_in += [tin]
print()
for i in range(no_staff):
print("{} worked for {} minutes".format(staff_list[i],
work_time[i]))
print()
print("Average number of minutes worked:
{}".format(round(sum(work_time)/len(work_time),1)))
TPSTAFF3
staff_list = []
time_in = []
time_out = []
work_time = []
wage = []
staff = input("Enter name of staff: ")
print()
for i in range(len(staff_list)):
print("{} worked for {} minutes".format(staff_list[i],
work_time[i]))
print()
print("Average number of minutes worked:
{}".format(round(sum(work_time)/len(work_time),1)))
print()
for i in range(len(staff_list)):
if work_time [i] <= 240:
wage = work_time[i]//15*3
else:
wage = (work_time[i]-240)//15*4 + 240//15*3
print("{} will be paid ${}".format(staff_list[i], wage))