Complete the following trace table for the given algorithm when the sensor type "Wind" and the reading code 182 are entered.
You may not need to use all rows in the table.
| Line number | sensor | reading | sensorID | Output |
|---|---|---|---|---|
| 01 | Wind | |||
| 02 | 182 | |||
Algorithm:
01 sensor = input("Enter sensor type")
02 reading = input("Enter reading code")
03 sensorID = sensor + str(reading)
04 while sensorID.length < 10
05 sensorID = "-" + sensorID
06 endwhile
07 print("PKT " + sensorID)
41 exam-style questions on OCR GCSE Computer Science Designing, creating and refining algorithms. Each one has a worked solution and a mark scheme showing where the marks go.