Data types
11
0/2

An automated logistics warehouse generates tracking references for shipping parcels using the following algorithm:

01 destination = input("Enter destination country code")
02 weight = input("Enter parcel weight in kg")
03 prefix = "SHIP-"
04 tracking_ref = prefix + destination + str(weight)
05 while tracking_ref.length < 12
06     tracking_ref = tracking_ref + "0"
07 endwhile
08 print("Tracking Reference: " + tracking_ref)

Define the term casting and state the line number where casting is used in this algorithm.

[2]

Data types Questions

Practise OCR GCSE Computer Science Data types with exam-style questions for GCSE Computer Science. 26 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

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types