37Easy
0/1

An algorithm is shown in Figure 2.

passengerAge ← USERINPUT
baggageWeight ← USERINPUT
extraCharge ← 0.0
msg1 ← "Standard allowance exceeded"
msg2 ← "Passenger too young to travel alone"

IF passengerAge >= 12 AND baggageWeight > 0.0 THEN
    IF baggageWeight > 23.0 THEN
        extraCharge ← 15.00
        OUTPUT extraCharge
    ELSE IF baggageWeight > 15.0 THEN
        extraCharge ← 5.00
        OUTPUT extraCharge
    ELSE
        OUTPUT "No extra charge"
    ENDIF
ELSE
    OUTPUT msg2
ENDIF

State how many possible values the result of the comparison baggageWeight > 23.0 could have.

[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