A system developer is writing a routine to validate airline baggage tags. A baggage tag is formatted as a string tagID (e.g. "BAG-582914-X"), where:
- is at index 3- precedes a single-character check digit at the endThe developer uses the variables firstHyphen (representing the index of the first hyphen, which is 3) and secondHyphen (representing the index of the second hyphen, which is 10 in the example) to identify the boundary positions.
Which pseudo-code statement correctly extracts the numeric identifier and assigns it to the variable numIdentifier?
numIdentifier ← SUBSTRING(firstHyphen, secondHyphen, tagID)
numIdentifier ← SUBSTRING(firstHyphen + 1, secondHyphen - firstHyphen, tagID)
numIdentifier ← SUBSTRING(firstHyphen + 1, secondHyphen - firstHyphen - 1, tagID)
numIdentifier ← SUBSTRING(secondHyphen - firstHyphen - 1, firstHyphen + 1, tagID)
89 exam-style questions on AQA GCSE Computer Science String handling operations in a programming language. Each one has a worked solution and a mark scheme showing where the marks go.