An algorithm, represented using pseudo-code, is used to calculate gym membership fees based on age and tier.
memberAge ← USERINPUT
membershipType ← USERINPUT
monthlyFee ← 0.0
errMessageOne ← "Must be over 12"
errMessageTwo ← "Invalid membership tier"
IF memberAge > 12 AND membershipType != "None" THEN
IF membershipType == "Premium" THEN
monthlyFee ← 45.0
OUTPUT monthlyFee
ELSE IF membershipType == "Standard" THEN
monthlyFee ← 30.0
OUTPUT monthlyFee
ELSE
OUTPUT errMessageTwo
ENDIF
ELSE
OUTPUT errMessageOne
ENDIF
State how many possible values the result of the comparison memberAge > 12 could have in the algorithm shown in Figure 1.
Practise AQA GCSE Computer Science Boolean logic with exam-style questions for GCSE Computer Science. 83 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.