2023 New Spec

From TRCCompSci - AQA Computer Science
Revision as of 09:07, 11 December 2023 by Admin (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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