Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
Question 45

Marcus owns a juice bottling plant.

This program checks the volume (in ml) of juice bottles from Marcus's plant.

1   count = 0
2   volume = 0
3   pass_count = 0
4   fail_count = 0
5
6   while (count < 4):
7       count = count + 1
8       volume = int (input ("Enter bottle volume: "))
9       if ((volume < 490) or (volume > 510)):
10          fail_count = fail_count + 1
11      else:
12          pass_count = pass_count + 1
13
14  print (pass_count, fail_count)

The inputs are: 505, 489, 490, 512

Complete the trace table showing the execution of the program with these inputs.

You may not need to fill in all the rows in the table.

countpass_countfail_countvolumeDisplay
------------------------------------------------
[6]
Markscheme

Computational thinking Questions

  1. GCSE
  2. /Computer Science
  3. /Computational thinking

Question bank