An algorithm has been written to control an automated ticket dispenser at an attraction based on the ticket category selected by the visitor.
Figure 1
1 category ← USERINPUT
2 IF category = 'adult' THEN
3 limit ← 4
4 ELSE IF category = 'child' THEN
5 lim ← 2
6 ELSE IF category = 'senior' THEN
7 limit ← 3
8 ELSE
9 OUTPUT 'invalid category'
10 ENDIF
11 FOR i ← 1 TO limit
12 IF i < 3 THEN
13 PRINT_TICKET('standard')
14 ELSE
15 PRINT_TICKET('priority')
16 ENDIF
17 ENDFOR
Write one line of code that would correct the error found in the algorithm in Figure 1.
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.