Question 5

AQA Computer Science June 2023 Paper 1 (7516/1)AS10 marks

On the specification

5.1
3.1 Fundamentals of programming3.3 Systematic approach to problem solving
5.2
3.3 Systematic approach to problem solving
Question text

5 The algorithm, represented using pseudo-code, in Figure 3 outputs a series of integers. The output depends upon the value entered by the user. Figure 3 OUTPUT "Enter an integer greater than 1: " INPUT Number X ← 2 Count ← 0 WHILE Number > 1 Multi ← FALSE WHILE (Number MOD X) = 0 IF NOT Multi THEN OUTPUT X ENDIF Count ← Count + 1 Multi ← TRUE Number ← Number DIV X ENDWHILE X ← X + 1 ENDWHILE OUTPUT Count Table 3 lists the MOD and DIV operators for each of the available programming languages. You should refer to the row for your programming language. Table 3 Programming language MOD DIV C# % / Java % / Pascal mod div Python % // VB.NET Mod \ What you need to do: Task 1 Write a program to implement the algorithm in Figure 3. Task 2 Test that your program works: • run your program, then enter the number 23 • run your program, then enter the number 25 • run your program, then enter the number 1260 Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 5.1 Your PROGRAM SOURCE CODE for Task 1. [9 marks] 5.2 SCREEN CAPTURE(S) showing the tests described in Task 2. [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.