Question 3

AQA Computer Science November 2020 Paper 1 (7516/1)AS11 marks

On the specification

3.1
3.1 Fundamentals of programming3.3 Systematic approach to problem solving
3.2
3.3 Systematic approach to problem solving
3.3
3.4 Theory of computation
Question text

3 The algorithm, represented using pseudo-code in Figure 2, outputs a series of integers or the message No result. The output depends upon the value entered by the user. Figure 2 OUTPUT "Enter an integer greater than 1: " INPUT X Product ← 1 Factor ← 0 WHILE Product < X Factor ← Factor + 1 Product ← Product * Factor ENDWHILE IF X = Product THEN Product ← 1 FOR N ← 1 TO Factor Product ← Product * N OUTPUT N ENDFOR ELSE OUTPUT "No result" ENDIF What you need to do: Task 1 Write a program to implement the algorithm in Figure 2. Task 2 Test that your program works: • run your program, then enter the number 720 • run your program, then enter the number 600 Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 3.1 Your PROGRAM SOURCE CODE for Task 1. [9 marks] 3.2 SCREEN CAPTURE(S) showing the tests described in Task 2. [1 mark] 3.3 What is true for all valid inputs for X that output a number of numbers which is not true for all other valid inputs that output No result? [1 mark] You are advised to spend no more than 25 minutes on this section. Enter your answers to Section B in your Electronic Answer Document. You must save this document at regular intervals. These questions refer to the Preliminary Material and the Skeleton Program, but do not require any additional programming. Refer either to the Preliminary Material issued with this question paper or your electronic copy.