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.
| count | pass_count | fail_count | volume | Display |
|---|---|---|---|---|
| ------- | ------------ | ------------ | -------- | --------- |
159 exam-style questions on Edexcel GCSE Computer Science Algorithms, covering Constructs for solving problems, Variables, constants and data structures, Arithmetic, relational and logical operators, Tracing algorithm output with trace tables, Types of error and correcting logic errors, Standard algorithms (sorts and searches), and Evaluating algorithm fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.