Question 2
OCR Computer Science November 2020 Paper 2GCSE8 marks
On the specification
- (a)
- 2.1 Algorithms2.2 Programming techniques
- (b)
- 2.5 Translators and facilities of languages
- (c)
- 2.6 Data representation
Question text
2 Dru writes the following program using a high-level language. 1 function newscore(a,b) 2 temp = a*b 3 temp = temp + 1 4 return temp 5 endfunction 6 score = 18 7 name = "Dru" 8 print (score) 9 print ("name") 10 print (newscore(score,2)) 11 print (score) (a) The following table contains the program code for each line where this program outputs values. State the values output by the program on each of the lines. Line Program code Value output 8 print (score) 9 print ("name") 10 print (newscore(score,2)) 11 print (score) [4] (b) Describe the advantages of writing the program in a high-level language instead of in assembly language. [2] (c) Describe how a character set is used to represent the string value stored in the variable name [2]