0% found this document useful (0 votes)
5 views3 pages

CTSS 2019 P2 Solution

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

CTSS 2019 P2 Solution

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Task 1

Qn Answer
1 =SUM(B4:B20)

2 =COUNTA(A4:A20)

3 =MAX(C4:C20)

4 One mark for working top formula, one mark for rest

=VLOOKUP(C4, $D$27:$F$30,3,TRUE)
=VLOOKUP(C5, $D$27:$F$30,3,TRUE)
=VLOOKUP(C6, $D$27:$F$30,3,TRUE)
=VLOOKUP(C7, $D$27:$F$30,3,TRUE)
=VLOOKUP(C8, $D$27:$F$30,3,TRUE)
=VLOOKUP(C9, $D$27:$F$30,3,TRUE)
=VLOOKUP(C10, $D$27:$F$30,3,TRUE)
=VLOOKUP(C11, $D$27:$F$30,3,TRUE)
=VLOOKUP(C12, $D$27:$F$30,3,TRUE)
=VLOOKUP(C13, $D$27:$F$30,3,TRUE)
=VLOOKUP(C14, $D$27:$F$30,3,TRUE)
=VLOOKUP(C15, $D$27:$F$30,3,TRUE)
=VLOOKUP(C16, $D$27:$F$30,3,TRUE)
=VLOOKUP(C17, $D$27:$F$30,3,TRUE)
=VLOOKUP(C18, $D$27:$F$30,3,TRUE)
=VLOOKUP(C19, $D$27:$F$30,3,TRUE)
=VLOOKUP(C20, $D$27:$F$30,3,TRUE)
5 In the top formula, one mark for the calculation, one mark for rounding
and one mark for the rest
=ROUND(-FV(D4,C4,0,B4)-B4, 4)
=-FV(D5,C5,0,B5)-B5
=-FV(D6,C6,0,B6)-B6
=-FV(D7,C7,0,B7)-B7
=-FV(D8,C8,0,B8)-B8
=-FV(D9,C9,0,B9)-B9
=-FV(D10,C10,0,B10)-B10
=-FV(D11,C11,0,B11)-B11
=-FV(D12,C12,0,B12)-B12
=-FV(D13,C13,0,B13)-B13
=-FV(D14,C14,0,B14)-B14
=-FV(D15,C15,0,B15)-B15
=-FV(D16,C16,0,B16)-B16
=-FV(D17,C17,0,B17)-B17
=-FV(D18,C18,0,B18)-B18
=-FV(D19,C19,0,B19)-B19
=-FV(D20,C20,0,B20)-B20
6 One mark for working top formula, one mark for rest
=IF(AND(B4>2000, C4>3), "Yes", "No")
=IF(AND(B5>2000, C5>3), "Yes", "No")
=IF(AND(B6>2000, C6>3), "Yes", "No")
=IF(AND(B7>2000, C7>3), "Yes", "No")
=IF(AND(B8>2000, C8>3), "Yes", "No")
=IF(AND(B9>2000, C9>3), "Yes", "No")
=IF(AND(B10>2000, C10>3), "Yes", "No")
=IF(AND(B11>2000, C11>3), "Yes", "No")
=IF(AND(B12>2000, C12>3), "Yes", "No")
=IF(AND(B13>2000, C13>3), "Yes", "No")
=IF(AND(B14>2000, C14>3), "Yes", "No")
=IF(AND(B15>2000, C15>3), "Yes", "No")
=IF(AND(B16>2000, C16>3), "Yes", "No")
=IF(AND(B17>2000, C17>3), "Yes", "No")
=IF(AND(B18>2000, C18>3), "Yes", "No")
=IF(AND(B19>2000, C19>3), "Yes", "No")
=IF(AND(B20>2000, C20>3), "Yes", "No")

Task 2

Qn Answer
7(a) students = 15

7(b) total = 0
average = total / 15
print ("The average score is ", average)

7(c) while score<0 or score>100:


score = int(input("Enter a score between 0
and 100: “))
8 students = int(input("Enter the number of
students: "))

Task 3

9 Single errors are underlines, errors requiring 2 corrections are in bold.


risk = {} #1 change dictionary to list
count = 0 #2 to decide on counter or count
bmi_total = 0
while counter <= 10: #3 should be 1000
height = int(input("Please enter your height
in meters: ")) #4Change to float
weight = int(input("Please enter your weight
in kg: ")) #5change to float
bmi = weight/height*height #6 add bracket for
height*height
bmi_total += bmi
if bmi > 18.5 or bmi < 27.5: #7 bmi < 18.5, #8
bmi > 27.5
print("You are at risk.")
risk = risk + bmi #9 risk.append(bmi)
counter += 1

bmi_average = bmi_total/counter
print("Average BMI "+ bmi_average) #10 "Average
BMI, bmi_average
print("The following students with these BMI are
at risk.")
for i in risk:
print(i)

Task 4

10 Correct input format


Number validation for input
Correct input style
Calculate total number of members
Print number of members above 55 years old
Print number of members below 16 years old
Print correct amount of discount

11 Picture of correct output


Output of correct format

12 Correct number of M and F


1 for M
1 for F
1 for method
Calculating oldest and youngest
1 for oldest
1 for youngest
1 for method
Correct average
1 for method
1 for rounding to 1 decimal place

13 Picture of correct output


Output of correct format

You might also like