Skip to content

Course home

Data types

Data types

Easy
1234567891011121314151617181920212223242526
Question 11

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]
Markscheme

Data types Questions

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

26 exam-style questions on OCR GCSE Computer Science Data types. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank