Question 3

Edexcel Computer Science June 2023 Paper 2GCSE15 marks

On the specification

6.1 Develop code6.3 Data types and structures6.4 Input and output
Question text

3 A program is used in a shop that sells building materials. The program reads in data about screws from a file. The data file is provided. The program counts the number of copper screws. The program stores the names of 12 bricks in an array. It writes the names of the bricks to a different file, one name per line. Brick names must be in uppercase. The program displays this output on the screen. Total screws: 26 Copper screws: 5 Wrote 12 brick names to file The output shows 26 screws were read from the file, and five are made from copper. It also shows 12 brick names were written to the file. Open file Q03.py Amend the code to make the program work and produce the correct output. You will need to: • amend some lines of code • choose between alternative lines of code. Make a choice by removing the # at the beginning of the line you choose to execute • run the program at least twice and check the output file each time to make sure it meets the requirements. Do not change the functionality of the given lines of code. Do not add any additional functionality. Save your amended code as Q03FINISHED.py (Total for Question 3 = 15 marks)