A-Level Computer ScienceYear UnknownQ1
Turn over. (2500U20-1) 5 © WJEC CBAC Ltd. 1 start is integer 2 . . . 3 . . . 4 mid is integer 5 6 set start = 0 7 set endv = 9999 8 . . . 9 10 input searchValue 11 12 repeat 13 set mid = (start + endv) DIV 2 14 . . . 15 set found = TRUE 16 output “SearchValue found at position”, Mid 17 endif 18 19 . . . 20 . . . 21 endif 22 23 if searchValue < stockCost[mid] then 24 set endv = mid – 1 25 endif 26 . . . 27 28 . . . 29 output “searchValue not found” 30 endif 31 End (b) This is an algorithm for a binary search. Fred’s intends to use the binary search algorithm shown to search the array stockCost. Several lines are missing from the algorithm. Copy the algorithm into your Section A answer document and complete it using lines selected from this list; [8] • endv is integer • set start = mid + 1 • if found = FALSE • found is Boolean • set found = FALSE • if searchValue = stockCost[mid] then • until (found = TRUE) OR (endv < start) • if searchValue > stockCost[mid] then (2500U20-1) 6 Section B: Develop programs Select the programming language of your choice from section BI, BII or BIII and answer both questions within your chosen section. BI Visual Basic Fred’s wants a prototype computer system to be developed using Visual Basic. 1. Open the file stock • Read through the code and familiarise yourself with its contents. • The file contains incomplete code which attempts to save stock details and return the number of stock items on file that match the search criteria entered e.g. expiry date. Complete this code. Save the changes made to the file stock. [8] 2. Using the internal facility of your chosen language, annotate the code from Question B1 above to clearly explain the design of this program to another software developer. Save the changes made to the file stock. [8] © WJEC CBAC Ltd. (2500U20-1) 7 © WJEC CBAC Ltd. Turn over. BII Java Fred’s wants a prototype computer system to be developed using Java. 1. Open the file stock • Read through the code and familiarise yourself with its contents. • The file contains incomplete code which attempts to save stock details and return the number of stock items on file that match the search criteria entered e.g. expiry date. Complete this code. Save the changes made to the file stock. [8] 2. Using the internal facility of your chosen language, annotate the code from Question B1 above to clearly explain the design of this program to another software developer. Save the changes made to the file stock. [8] (2500U20-1) 8 © WJEC CBAC Ltd. BIII Python Fred’s wants a prototype computer system to be developed using Python. 1. Open the file stock • Read through the code and familiarise yourself with its contents. • The file contains incomplete code which attempts to save stock details and return the number of stock items on file that match the search criteria entered e.g. expiry date. Complete this code. Save the changes made to the file stock. [8] 2. Using the internal facility of your chosen language, annotate the code from Question B1 above to clearly explain the design of this program to another software developer. Save the changes made to the file stock. [8] END OF PAPER

Paper Source:WACS222P.pdf
Get full Socratic AI guidance on this question — free in the Applaa desktop app
Appy Buddy guides you step-by-step toward the answer without giving it away. Type your attempt and get instant, mark-scheme-aware clues that teach you to think like an examiner.
Applaa Desktop App
Join Applaa Community
Create your own games, learn AI concepts, program interactive apps, and share with a kid-safe community approved by parents. Free forever on Windows and Mac.
Download Free
Available for Windows and macOS · COPPA Compliant
Exam Specification Info
This question is part of the UK A-Level Computer Science syllabus. In the actual exam, structured questions typically require linking specific keywords to gain full marks. Applaa helps you drill these topics.
Syllabus levelAdvanced Level (A-Level)
SubjectComputer Science
Official MarksVariable (2–6 marks)