20Easy
0/1

An algorithm, represented using pseudo-code, is used to calculate gym membership fees based on age and tier.

Figure 1

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.

[1]

Boolean logic Questions

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.

PreviousNext

Boolean logic Questions

  1. GCSE
  2. /Computer Science
  3. /Boolean logic