Designing, creating and refining algorithms
43
0/4

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 numbersensorreadingsensorIDOutput
01Wind
02182

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)
[4]

Designing, creating and refining algorithms Questions

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.

PreviousNext

Designing, creating and refining algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Designing, creating and refining algorithms