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)
Practise OCR GCSE Computer Science Designing, creating and refining algorithms with exam-style questions for GCSE Computer Science. 50 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 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.