ZHSS 7155_PRELIMS_2022_4E_P2_MS
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Mark Scheme and Answer Key Task 1 Mark Scheme 1. Accept only =SUM( ) to score 1 mark 2. Accept only =MAX( ) to score 1 mark 3. Accept only =ROUND(AVERAGE( ), 0) OR =SUM()/COUNT() to score 2 marks 4. Accept only =IF() with MAX() and LARGE() and " ", Correct Labels to score 4 marks 5. Check the Manage Rules for this setting, all correct entries to score 2 marks Task 2 Question 6 Award 1 mark for modification to program to allow for any number of fish to be entered. Typical strategy is to get user to input number of fish and use for loop. Award 1 mark for the suitable input message. Question 7 Award 1 mark for each combination of weight, length and output message accomplished. Question 8 Award 1 mark for correct naming of the list – fishweight and storage of weight data. Award 1 mark for correct naming of the list – fighlength and storage of length data. Award 1 mark for correctly outputting the average weight. Award 1 mark for correctly outputting the average length.
Task 3 [How I went about planting the bugs] 1 mark per error, indicated by red arrow.
CORRECTLY EDITED PROGRAM def mult(a, b): # multiply function using repeated addition algorithm # a and b must be integers, by using type casting a = int(a) b = int(b) # validate if either a or b is zero if a == 0 or b == 0: return 0 # check sign if a < 0 and b < 0: neg_sign_flag = False elif a < 0 or b < 0: neg_sign_flag = True else: neg_sign_flag = False # convert both integers to absolute value a , b = abs(a) , abs(b) # iterate addition accum = 0 for i in range(b): # make b the multiplier accum += a # return the multiplied value, with the appropriate sign if neg_sign_flag: return -accum else: return accum # User Input and Test Run a = input("please input the first integer: ") b = input("please input the second integer: ") print(str(a)+" multiplied by "+str(b)+" equals "+str(mult(a,b)))
Task 4 Question 12 Award 2 marks for input of 4 digit number and suitable label. Question 13 Award 2 marks for each scenario handled, for max of 10 marks. Question 14 Award 1 mark for each test A and B, 2 marks for Test C. Award 1 mark for correctly named and created jpg file. Question 15 Award 1 mark for changes made in the Random number generation section. Award 1 mark for player input and suitable label. Award 1 mark for game loop modifications.
TASK 2 MARKETFISH_2022_SAMPLE_CODE_ANSWER #Q7 msg_list = ['This fish is not heavy enough. Return to Extra Feed Pen.', 'This fish is not long enough. Return to Growing Pen.', 'This fish is not heavy enough and not long enough. Return to Original Pen.', 'This fish is heavy enough and long enough. Bag it for Market.'] number_fish = int(input('Please enter number of fish to w
Content continues in the PDF.
Related notes
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 MSExam Papers · 2024
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices

