Skip to content

Course home

Programming fundamentals

Programming fundamentals

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
Question 56

A drone logistics network routes automated deliveries to different distribution hubs. Each hub has a unique zone code as shown below:

CodeHub Location
NZNorth Zone Hub
SZSouth Zone Hub
EZEast Zone Hub

A system program is used to dispatch a parcel to a locker at one of these hubs. The program:

  • requests the operator to enter the hub code
  • validates the entered code using the function IsValidHub()
  • if the code is valid, requests the specific locker compartment number
  • joins the hub code and locker number to generate a unique dispatch code
  • runs the RoutePackage() subroutine
01  hubID = input("Enter hub identifier: ")
02  // Validate input
03  validHub = IsValidHub(hubID)
04  if validHub == true then
05      lockerIdx = input("Enter locker index: ")
06      routeLabel = hubID + lockerIdx
07      RoutePackage(routeLabel)
08  endif

Give the line number where concatenation is used.

[1]
Markscheme

Programming fundamentals Questions

  1. GCSE
  2. /Computer Science
  3. /Programming fundamentals

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

Question bank