Partial preview of the text
Download AQA GCSE COMPUTER SCIENCE Paper 1 Computational thinking and programming skills – Python Q and more Exams Biology in PDF only on Docsity!
ee pe Please write clearly in block capitals. Centre number Candidate number Surname Forename(s) Candidate signature GCSE COMPUTER SCIENCE Paper 1 Computational thinking and programming skills - Python | declare this is my own work. Monday 12 May 2025 Afternoon Time allowed: 2 hours Materials — e There are no additional materials required for this paper. 17, e You must not use a calculator. f Question Mark For Examiner's Use Instructions e Use black ink or black ball-point pen. Use pencil only for drawing. Answer all questions. You must answer the questions in the spaces provided. If you need extra space for your answer(s), use the lined pages at the end of this book. Write the question number against your answer(s). Do all rough work in this book. Cross through any work you do not want to be marked. * Questions that require a coded solution must be answered in Python. e You should assume that all indexing in code starts at 0 unless stated otherwise. Elwfolalafofr}= Information 10 The total number of marks available for this paper is 90. 14 TOTAL Advice For the multiple-choice questions, completely fill in the lozenge alongside the appropriate answer. CORRECT METHOD [e] WRONG METHODS [=[¢] If you want to change your answer you must cross out your original answer as shown. 4 If you wish to return to an answer previously crossed out, ring the answer you now wish to select as shown. ILA ory) JUN25 85251801 852571B IB/G/Jun25/G4003/E11 Do not write outside the [o[1].[3] State the relational operator used in the program in Figure 1. a [1 mark] [4] Complete the trace table for the program in Figure 1. You may not need to use all the rows in the table. [4 marks] a b c Output 7 Turn over for the next question Turn over > | ll ll l | for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B Do not write itside the A coffee shop has a loyalty scheme which rewards customers for buying drinks. ae The customer gets one stamp on their loyalty card for each individual drink they buy. e Every 4th stamp on the card gets the customer a free biscuit. e Every 5th stamp on the card gets the customer a free pastry. e When the customer reaches 20 stamps, they get a free cake (but no biscuit or pastry). The Python program shown in Figure 2 should display whether the customer gets a free biscuit, pastry, cake or nothing free for their first 20 drinks. For each drink purchased, the program must output either: "Free biscuit", "Free pastry", "Free cake" or"Nothing free". Some parts of the program have been replaced with the labels @ to ®. Figure 2 iel while i <= 20: if i % 20 == print ("Free cake") elif @: print ("Free pastry") elif i % 4 == else: i=sitil [4] State the Python code that should be written in place of the labels in the program written in Figure 2. [3 marks] | ll ll | ll for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B Donot write outside the Write a Python program that calculates the total cost of a netball coaching session for tox a group of students. The total cost is calculated as follows: ¢ A booking fee of £20 plus: o £5 per student if there are 15 students or fewer o £3 per student if there are more than 15 students e If there are more than 25 students, a booking fee of £100 and no other charges. Your program should: ¢ get the user to enter the number of students ¢ output the total cost of the session. You should use indentation as appropriate, meaningful variable name(s) and Python syntax in your answer. The answer grid below contains vertical lines to help you indent your code. [8 marks] O02 ll for more: tyrionpapers.com IB/G/Jun25/8525/1B Donot write outside the box Turn over > | ll ll l | for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B Donot write outside the box Question 4 continues on the next page Turn over > | ll ll l | for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B [3] Which of the following statements best describes boundary test data? 10 Donot write outside the box Shade one lozenge. [1 mark] A Data that is not of the allowed data type Le] B Data that is at the limits of the allowed range Le] C Data that is expected by the program fe] D Data that will cause a syntax error fe] [4] The programmer has started planning the tests that will be used to check the program [o]4]/5] is working correctly. The program should: ¢ check that the first name has more than one character and fewer than 15 characters: o ifit has, then output the message Name accepted o ifit has not, then output the message Name not accepted The start of the test plan is shown in Figure 3. Figure 3 Test Type of number Test data test data Expected result 1 Thomas Normal Name accepted 2 Boundary Name not accepted State the number of characters that a string used for test number 2 in Figure 3 could contain. [1 mark] Normal and boundary are two types of test data. State one type of test data that has not been used in Figure 3. [1 mark] | ll ll | ll for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B 12 Donot write outside the box [6] A programmer is designing an algorithm to generate usernames for users. The algorithm should: ¢ ask the user to input their first name and their last name ¢ create a username: o if their first name has more than three characters, their username will consist of the first three characters of their first name followed by their last name o if their first name has three or fewer characters, their username will consist of their full first name followed by their last name ¢ output the username. Figure 4 contains the statements required to implement a version of this algorithm. Figure 4 firstName € USERINPUT LEN(firstName) > 3 username € firstName + lastName OUTPUT username username € SUBSTRING(0, 2, firstName) + lastName lastName € USERINPUT Using the labels @ to ® shown in Figure 4, complete the flowchart to implement the algorithm. [3 marks] IB/G/Jun25/8525/1B | ll ll | ll for more: tyrionpapers.com 02 13 Donot write outside the box START STOP 13 Turn over for the next question Turn over > | ll ll l | for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B 15 IB/G/Jun25/8525/1B Do not write outside the [4] Rewrite the program in Figure 5 so that it achieves the same result but uses an box iteration structure that contains only one input () statement. Your answer must be written in Python. You should use indentation as appropriate, meaningful variable name(s) and Python syntax in your answer. The answer grid below contains vertical lines to help you indent your code. [5 marks] 8 Turn over > MW a O02 16 Do not write outside the A series of numbers shown in Figure 6 are to be sorted into ascending order (from box smallest to largest). Figure 6 45 23 78 55 49 [4] A bubble sort algorithm has been developed to sort the numbers in Figure 6. Fill in the table to show the steps involved in applying a bubble sort algorithm to sort the numbers shown in Figure 6. You should show the new order every time the order has changed. [3 marks] 45 23 78 55 49 23 45 49 55 78 | ll ll | ll for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B 18 Do not write itside the [3] State one advantage and one disadvantage of a bubble sort compared to a merge ae sort. [2 marks] Advantage Disadvantage. [4] The programmer has an array of 2500 numbers, stored in ascending order (smallest to largest). The programmer needs to write a program to search for a value in the array. Explain why a binary search is better than a linear search for this array. [2 marks] 10 IB/G/Jun25/8525/1B | ll ll | ll for more: tyrionpapers.com 02 19 Do not write ‘ outside the Turn over for the next question box DO NOT WRITE ON THIS PAGE ANSWER IN THE SPACES PROVIDED Turn over > | ll ll l ll for more: tyrionpapers.com 02 IB/G/Jun25/8525/1B