12
6 This flowchart inputs a range of temperatures in degrees Fahrenheit.
As each temperature is input, it is compared with the previous highest temperature. If it is higher
than the current highest, it replaces the previous highest temperature and then it is converted to
degrees Celsius.
For ease of calculation, the final step of the Fahrenheit to Celsius conversion has been
approximated as division by 2.
When –1 is entered, the input process stops and the highest temperature (in both Fahrenheit and
Celsius) is output.
START
HighF -100
HighC -100
INPUT TempF
Is TempF No Is TempF No
= -1? > HighF?
Yes Yes
HighF TempF
HighC (TempF-32)/2
OUTPUT 'The highest temperature is, ',
HighF, ' Fahrenheit, ',
HighC, ' Celsius.'
END
© UCLES 2017 0478/21/M/J/17
13
Complete the trace table for the input data:
68, 46, 50, 86, 65, 50, 40, 30, –1
HighF HighC TempF OUTPUT
[5]
© UCLES 2017 0478/21/M/J/17 [Turn over
8
3 This flowchart inputs the weight in kilograms of a passenger stepping into a lift. The lift can take a
maximum of eight passengers or a maximum weight of 640 kilograms.
START
totalWeight 0
totalNumber 0
INPUT Weight
totalWeight totalWeight + Weight
totalNumber totalNumber + 1
Is
Yes
totalWeight
> 640?
No
No Is
Yes
totalNumber
> 8?
OUTPUT 'Lift
overload, step
out'
END
© UCLES 2018 0478/22/F/M/18
9
Complete the trace table for the passenger input data:
50, 70, 65, 100, 95, 50, 55, 85, 70, 75
Weight totalWeight totalNumber OUTPUT
[4]
© UCLES 2018 0478/22/F/M/18 [Turn over
8
3 This flowchart inputs the weight of items in kilograms to be loaded on a trailer. Any item over
25 kilograms is rejected. The trailer can take up to 100 kilograms.
START
TotalWeight 0
Reject 0
INPUT Weight
Yes
Is Weight
Reject Reject + 1
˃ 25?
No
TotalWeight TotalWeight + Weight
No Is
TotalWeight
˃ 100?
Yes
TotalWeight TotalWeight – Weight
OUTPUT 'Weight of items '’
TotalWeight, ' Number of
items rejected ',Reject
END
© UCLES 2017 0478/22/M/J/17
9
Complete the trace table for the input data:
13, 17, 26, 25, 5, 10, 15, 35, 20, 15
Weight Reject TotalWeight OUTPUT
[5]
© UCLES 2017 0478/22/M/J/17 [Turn over
8
4 Study the flowchart.
START
INPUT A OUTPUT B
IS Yes B A
A > 0 ? B B + A C C – 1
C A
No
IS
OUTPUT C <= 1 ? Yes
'Exit'
No
END
Complete the trace table for the input values 4, 3, −1:
A B C OUTPUT
[4]
© UCLES 2017 0478/22/F/M/17