j276/02, computational thinking, algorithms and ......computer science (9-1) j276/02, computational...

22
Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you may see slight differences between this paper and the original. Candidates answer on the Question paper. OCR supplied materials: Additional resources may be supplied with this paper. Other materials required: Pencil Ruler (cm/mm) Duration: 90 mins Candidate forename Candidate surname Centre number Candidate number INSTRUCTIONS TO CANDIDATES Write your name, centre number and candidate number in the boxes above. Please write clearly and in capital letters. Use black ink. HB pencil may be used for graphs and diagrams only. Answer all the questions, unless your teacher tells you otherwise. Read each question carefully. Make sure you know what you have to do before starting your answer. Where space is provided below the question, please write your answer there. You may use additional paper, or a specific Answer sheet if one is provided, but you must clearly show your candidate number, centre number and question number(s). INFORMATION FOR CANDIDATES The quality of written communication is assessed in questions marked with either a pencil or an asterisk. In History and Geography a Quality of extended response question is marked with an asterisk, while a pencil is used for questions in which Spelling, punctuation and grammar and the use of specialist terminology is assessed. The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 82. The total number of marks may take into account some 'either/or' question choices. © OCR 2020. You may photocopy this page. 1 of 22 Created in ExamBuilder

Upload: others

Post on 21-Jun-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Computer Science (9-1)

J276/02, Computational thinking, algorithms andprogramming, SpecimenJohn QuesnellPlease note that you may see slight differences betweenthis paper and the original.

Candidates answer on the Question paper.

OCR supplied materials:Additional resources may be supplied with this paper.

Other materials required:• Pencil• Ruler (cm/mm)

Duration: 90 mins

Candidate

forename

Candidate

surname

Centre number Candidate number

INSTRUCTIONS TO CANDIDATES• Write your name, centre number and candidate number in the boxes above. Please write clearly and in capital letters.• Use black ink. HB pencil may be used for graphs and diagrams only.• Answer all the questions, unless your teacher tells you otherwise.• Read each question carefully. Make sure you know what you have to do before starting your answer.• Where space is provided below the question, please write your answer there.• You may use additional paper, or a specific Answer sheet if one is provided, but you must clearly show your candidate number, centre number and question number(s).

INFORMATION FOR CANDIDATES• The quality of written communication is assessed in questions marked with either a pencil or an asterisk. In History and Geography a Quality of extended response question is marked with an asterisk, while a pencil is used for questions in which Spelling, punctuation and grammar and the use of specialist terminology is assessed.• The number of marks is given in brackets [ ] at the end of each question or part question.• The total number of marks for this paper is 82.• The total number of marks may take into account some 'either/or' question choices.

© OCR 2020. You may photocopy this page. 1 of 22 Created in ExamBuilder

Page 2: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

1(a). Kofi uses his computer to record an audio file of himself playing his guitar.

Outline what happens when the computer converts the music into a file.

[2]

(b). Kofi increases the sample rate his computer is using to record his guitar.

Explain two effects this will have on Kofi's recording.

1

2

[4] (c). Kofi is emailing his recording to a record label. He uses lossy compression to produce the music file.

Explain two reasons why using lossy compression is beneficial.

1

2

[4]

© OCR 2020. You may photocopy this page. 2 of 22 Created in ExamBuilder

Page 3: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

2(a). Order the following units from smallest to largest:

GB bit PB byte nibble MB

[1] (b). Convert the decimal number 191 into an 8 bit binary number.

[1] (c). Convert the hexadecimal number 3E into a decimal number. You must show your working.

[2]

© OCR 2020. You may photocopy this page. 3 of 22 Created in ExamBuilder

Page 4: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(d). There is a subroutine, HEX(), that takes a denary number between 10 and 15 and returns the correspondinghexadecimal number. E.g. HEX(10) would return “A”, HEX(15) would return “F”.

Write an algorithm, using the subroutine HEX(), to convert any whole decimal number between 0 and 255 into a2 digit hexadecimal number.

[4]

© OCR 2020. You may photocopy this page. 4 of 22 Created in ExamBuilder

Page 5: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(e).

(i) Add together the following two 8 bit binary numbers. Express your response in an 8 bit binary form.

01101010

10010110

[2]

(ii) Identify the problem this addition has created.

[1]

3(a). Complete a 2 place right shift on the binary number 11001011.

[1] (b). Explain the effect of performing a 2 place right shift on the binary number 11001011.

[2] (c). Complete the truth table below for the Boolean statement p = NOT (A AND B).

[2]

© OCR 2020. You may photocopy this page. 5 of 22 Created in ExamBuilder

Page 6: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

4(a). Johnny is writing a program to create usernames. The first process he has developed is shown in the flowchartin Fig. 1.

For example, using the process in Fig. 1, Tom Ward's user name would be TomWa.

State, using the process in Fig. 1, the username for Rebecca Ellis.

[1]

© OCR 2020. You may photocopy this page. 6 of 22 Created in ExamBuilder

Page 7: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(b). Johnny has updated the process used to create usernames as follows:

If the person is male, then their username is the last 3 letters of their surname and the first 2 letters of theirfirst name.If the person is female, then their username is the first 3 letters of their first name and the first 2 letters oftheir surname.

• What would be the username for a male called Fred Biscuit using the updated process?

[1]

• Write an algorithm for Johnny to output a username using the updated process.

[6]

© OCR 2020. You may photocopy this page. 7 of 22 Created in ExamBuilder

Page 8: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

5(a). Harry is planning to create a computer game using a high-level programming language.

State why the computer needs to translate the code before it is executed.

[1] (b). Harry can use either a compiler or an interpreter to translate the code.

Describe two differences between how a compiler and an interpreter would translate Harry's computer game.

[4]

© OCR 2020. You may photocopy this page. 8 of 22 Created in ExamBuilder

Page 9: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

6(a). Heath is researching how long, to the nearest minute, each student in his class spends playing computer gamesin one week (Monday to Friday). He is storing the data in a 2D array.

Fig. 2 shows part of the array, with 4 students.

For example, student 1, on Monday (day 0), played 30 minutes of computer games.

Explain why Heath is using an array to store the data.

[2] (b).

(i) Identify a data type that could be used to store the number of minutes in this array.

[1]

(ii) State why this data type is the most appropriate.

[1]

© OCR 2020. You may photocopy this page. 9 of 22 Created in ExamBuilder

Page 10: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(c). Heath wants to output the number of minutes student 3 played computer games on Wednesday (day 2). Hewrites the code:

print (hoursPlayed[3,2])

The output is 20.

(i) Write the code to output the number of minutes student 0 played computer games on Wednesday.

[1]

(ii) State the output if Heath runs the code:

print (hoursPlayed[2,1])

[1]

(iii) State the output if Heath runs the code:

print (hoursPlayed[3,1] + hoursPlayed[3,2])

[1]

(iv) Write an algorithm to output the total number of minutes student 0 played computer games from Monday(day 0) to Friday (day 4).

[3]

© OCR 2020. You may photocopy this page. 10 of 22 Created in ExamBuilder

Page 11: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(d). Heath has the day of the week stored as a number e.g. 0 = Monday, 1 = Tuesday.

Write a sub-program that takes the number as a parameter and returns the day of the week as a string.

[5]

© OCR 2020. You may photocopy this page. 11 of 22 Created in ExamBuilder

Page 12: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(e). Heath needs to work out the average number of minutes spent playing computer games each day for the class,which contains 30 students. Write an algorithm to output the average number of minutes the whole class spendsplaying computer games each day.

[8]

© OCR 2020. You may photocopy this page. 12 of 22 Created in ExamBuilder

Page 13: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

7(a). Willow has created a hangman program that uses a file to store the words the program can select from. Asample of this data is shown in Fig. 3.

Show the stages of a bubble sort when applied to data shown in Fig. 3.

[4]

(b).A second sample of data is shown in Fig. 4.

Show the stages of a binary search to find the word ‘zebra’ when applied to the data shown in Fig. 4.

[4]

© OCR 2020. You may photocopy this page. 13 of 22 Created in ExamBuilder

Page 14: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

8(a). The area of a circle is calculated using the formula Π × r2, where Π is equal to 3.142 and r is the radius.

Finn has written a program to allow a user to enter the radius of a circle as a whole number, between 1 and 30,and output the area of the circle.

Explain, using examples from the program, two ways Finn can improve the maintainability of the program.

[6]

© OCR 2020. You may photocopy this page. 14 of 22 Created in ExamBuilder

Page 15: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

(b). Identify two variables used in the program.

[2]

(c).

(i) Identify one item in the program that could have been written as a constant.

[1]

(ii) Give one reason why you have identified this item as a constant.

[1]

(d). Finn uses an IDE (Integrated Development Environment) to write his programs. Identify two features of an IDEthat Finn might use.

[2]

END OF QUESTION PAPER

© OCR 2020. You may photocopy this page. 15 of 22 Created in ExamBuilder

Page 16: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

1 a The height of the wave is measured /sampled (at regular / set intervals)Turned into / stored as binary

2 1 mark for each bullet, to a maximum of 2.

b The quality will improve …… because the sound wave is moreaccurate to the originalThe file size will increase …… because there are more samples tostore 4

4 1 mark for each bullet.(1 mark for identification of the effect, onemark for an explanation)

c Lossy means the decompressed file is notidentical to the original……the difference is unlikely to be noticed byhumansLossy will decrease the file size …… so it can be sent via e-mail

2 1 mark for each bullet.(1 mark for identification of the effect, onemark for an explanation)

Total 10

2 a bit, nibble, byte, MB, GB, PB 1 1 Correct Answer Only

b 10111111 1 Correct Answer Only

c Working; (3* 16) + 14 OR 0011111062

2 1 mark for correct answer, 1 for validmethod of working

d Taking a number as inputUsing HEX subroutine correctlyCalculating Digit 1Calculating Digit 2

INPUT decimaldigitl = decimal DIV 16IF digitl>=10 THEN digit1 = HEX(digit1)digit2 = decimal - (digit1*16)IF digit2>=10 THEN digit2=HEX(digit2)

4 1 mark for each bullet.

There are no marks associated with datatypes or conversions of data types.

If used, a flowchart should represent thebulleted steps in the answer column.

e i 0000 0000 2 Correct Answer Only1 mark per nibble

ii overflow 1 Correct Answer Only

Total 11

3 a 00110010 1 Correct Answer Only

b The number is divided by 4Loss of accuracy …… the bits on the right are removed… the bits on the right are removed

2 1 mark per bullet to a maximum of 2.

© OCR 2020. You may photocopy this page. 16 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance

Page 17: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

c 2 1 mark for each correct answer in table.

Total 5

4 a RebEl 1 Correct Answer Only (allow any case)

b i UitFr 1 Correct Answer Only (allow any case)

ii Taking firstname, surname and genderas inputChecking IF gender is male / female(using appropriate selection)For male …Generating last 3 letters ofsurname using appropriate stringmanipulation…Generating first 2 of letters offirstname and adding to previousFor female…. correctly calculating asbeforeCorrect concatenation and output

input firstname, surname, genderif gender = “Male” then username = RIGHT(surname, 3) +LEFT(firstname,2)else username = LEFT (firstname,3) +LEFT(surname,2)end ifprint (username)

6 1 mark for each correct bullet to amaximum of 6.

If used, a flowchart should represent thebulleted steps in the answer column

Total 8

© OCR 2020. You may photocopy this page. 17 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance

Page 18: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

5 a To convert it to binary / machine codeThe processor can only understandmachine code

1 Maximum 1 mark

b Compiler translates all the code in onego…… whereas an interpreter translatesone line at a timeCompiler creates an executable……whereas an interpreter does not /executes one line at a timeCompiler reports all errors at the end…… whereas an interpreter stops when itfinds an error

4 1 mark to be awarded for the correctidentification and one for a valid descriptionup to a maximum of 4 marks. No morethan 2 marks for answers relating only tointerpreters and no more than 2 marks foranswers only relating to compilers.

Total 5

© OCR 2020. You may photocopy this page. 18 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance

Page 19: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

6 a Allows multiple items of data to bestored …under one identifier / nameCan store a table structureReduces need for multiple variables

2 1 mark for each bullet to a maximum of 2.

b i Integer 1 Any data type that stores a whole numberonly

ii It is a whole number / no decimals / to thenearest minute.

1

c i print (hoursPlayed[0,2]) 1 Correct Answer Only

ii 1 Correct Answer Only

iii 80 1 Correct Answer Only

iv Adding all correct elementsOutputting correctlyUsing a loop

e.g.total = 0for x = 0 to 4 total = total + hoursPlayed[0,x]next xprint (total)

3 1 mark per bullet to a maximum of 3.If used, a flowchart should represent thebulleted steps in the answer column

© OCR 2020. You may photocopy this page. 19 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance

Page 20: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

d Appropriate declaration of a functionthat takes day number as parameterand returns dayUse of selection (if / switch)Appropriate comparisonCorrect identification of each dayCase default

e.g.

function returnDay(dayNo As String) AsString switch dayNo case 0: returnDay = “Monday” case 1: returnDay = “Tuesday” case 2: returnDay = “Wednesday” case 3: returnDay = “Thursday” case 4: returnDay = “Friday” case default: returnDay = “Invalid” endswitchendfunction

5 1 mark per bullet to a maximum of 5.

If used, a flowchart should represent thebulleted steps in the answer column.

e Loop 0 to 29Loop 0 to 4Accessing hoursplayed[x,y]Addition of hoursplayed[x,y] to totalCalculating average correctly outsideof loopsOutputting the results

e.g.total = 0for x = 0 to 29 for y = 0 to 4 Total = total + hoursPlayed[x,y] next ynextxaverage = total / (30*5)print (average)

6 Accept any type of average calculation(mean, median, mode).

If used, a flowchart should represent thebulleted steps in the answer column.

Total 23

© OCR 2020. You may photocopy this page. 20 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance

Page 21: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

7 a crime

bait fright victory

nymph

loose

bait crime

fright victory

nymph

loose

bait crime

fright nymph

victory

loose

bait crime

fright nymph

loose victory

bait crime

fright loose nymph

victory

4 1 mark for each row from row 2-5. Allowmultiple swaps in one stage, where it isclear that a bubble sort has been applied.

b Comparing zebra to orangeGreater, so split and take right sideFurther comparison (1 or 2 dependingon choices made)Correct identification of zebra usingmethodology above

e.g.compare zebra to orange

greater, split right

compare to wind

greater, split right

compare to zebra

4 1 mark per bullet (multiple ways through,marks awarded for appropriate comparisonand creation of sub groups).

Total 8

© OCR 2020. You may photocopy this page. 21 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance

Page 22: J276/02, Computational thinking, algorithms and ......Computer Science (9-1) J276/02, Computational thinking, algorithms and programming, Specimen John Quesnell Please note that you

Mark Scheme

8 a Comments / annotation…… To explain the key functions /sections… E.g. any relevant example, such asline 4 checks the input is validIndentation…… To show where constructs / sectionsstart and finish…E.g. indenting within IF statementUsing constants…… so numbers can be updated easily…E.g. TT

6 1 mark for identification of an example fromthe programme.1 mark for explanation of how it aidsmaintainability.1 mark for contextualisation.Maximum of 3 marks per method.

b radiusarea

2

c i 3.1422130

1 Maximum of 1 mark

ii The number does not need to bechanged while the program is runningThe number can be updated once andit updates throughout 1 (A01 1a)Maximum of 1 mark

1 Maximum of 1 mark

d Error diagnostics (any example)Run-time environmentEditor (any feature such as auto-correct, auto-indent)TranslatorVersion controlBreak pointStepping

2 1 mark per bullet to a maximum of 2marks. Only 1 example per bullet, e.g. auto-correct and auto-indent would only gain 1mark.

Total 12

Powered by TCPDF (www.tcpdf.org)

© OCR 2020. You may photocopy this page. 22 of 22 Created in ExamBuilder

Question Answer/Indicative content Marks Guidance