Question 2
OCR Computer Science Specimen Paper 2GCSE10 marks
On the specification
- (a)
- 2.2 Programming fundamentals
- (b)
- 2.1 Algorithms2.2 Programming fundamentals
Question text
2 A program needs to perform the following tasks: • Input two numbers from the user • Compare both numbers and output the largest number. (a) Complete the pseudocode for this program. num1 = num2 = input("enter second number") num1 > then else endif [5] (b) A second program needs to perform the following tasks: • Input a number from the user • Double the number input and print the result • Repeat bullets 1 and 2 until the user enters a number less than 0. Write an algorithm for this program.