Question 4

AQA Computer Science June 2024 Paper 1 (7516/1)AS9 marks

On the specification

4.1
3.1 Fundamentals of programming3.3 Systematic approach to problem solving
4.2
3.3 Systematic approach to problem solving
Question text

4 Figure 2 shows an algorithm represented using pseudo-code. Figure 2 OUT_NOLF "Enter an integer: " INPUT Number1 OUT_NOLF "Enter another integer: " INPUT Number2 IF Number1 > Number2 THEN Number ← Number1 DIV Number2 ELSE Number ← Number2 DIV Number1 ENDIF Count ← 0 WHILE Count ≠ Number Count ← Count + 1 IF (Count MOD 10) = 0 THEN OUT_NOLF "X" ELSE IF (Count MOD 5) = 0 THEN OUT_NOLF "V" ELSE OUT_NOLF "/" ENDIF ENDIF ENDWHILE The OUT_NOLF command displays the output without a line feed. The following series of OUT_NOLF commands will display ABC: OUT_NOLF "A" OUT_NOLF "B" OUT_NOLF "C" Table 2 lists the MOD and DIV operators for each of the available programming languages. You should refer to the row for your programming language. Table 2 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 2. Task 2 Test that your program works: • run your program • enter 4 • enter 99 Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 4.1 Your PROGRAM SOURCE CODE for Task 1. [8 marks] 4.2 SCREEN CAPTURE(S) showing the test 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.