Question 4
OCR Computer Science June 2024 Computer principles (H046-01)AS12 marks
On the specification
- (a)
- 1.2 Software and software development
- (b)
- 1.2 Software and software development
- (c)
- 1.2 Software and software development
Question text
4 All source code needs to be translated into object code using a translator. (a) Tick one box in each row to indicate which type of translator is being used. Compiler Interpreter Assembler Creates an executable file Creates one line of object code for each line of source code Translates all the high-level code at once A program needs to be translated each time it is run [4] (b) A software development company has written a new computer game in a high-level language. Identify which type of translator would be the most suitable for the computer game and give a reason why. Type Reason [2] (c) The pseudocode algorithm here will take in two numbers from the user, multiply them together using addition and output the result. For example, 4 multiplied by 3 would be 4 + 4 + 4 = 12. You can assume the function input takes in a value as an integer. numA = input("Enter first number") numB = input("Enter second number") answer = 0 while (numB > 0) answer = answer + numA numB = numB – 1 endwhile print(answer) Write this algorithm in assembly language using the Little Man Computer (LMC) instruction set. [6]