On a school race screen, why does runner 07 need that zero when 7 runners don't?
At a school athletics meet in Leeds, the race screen shows runner zero seven, but the results say seven runners took part. Both use the digit seven. Why does the zero matter in one place and make no difference in the other?
You can use an integer for the runner count because seven is a whole number. You can use a real for thirteen point four seconds because the time has a fractional part. Now look at the finished flag, the lane letter and the runner's name. Which types fit those values?
Before Aisha crosses the line, the answer to ‘Has she finished?’ is False. She crosses, and the answer changes to True. That finished flag is a Boolean. A Boolean has exactly two truth values: True and False.
Sam is still running when you check the race screen. The flag answers the question ‘Has Sam finished?’ Pick the value that belongs in the finished flag right now.
Compare lane C with the name Aisha Khan. The lane label has one letter, so you can store it as a character. The name has several letters and a space. You can store the whole sequence of characters as a string.
Start with the printed race ID, zero seven. If you store it as an integer, you get the value seven. That value doesn't tell you there was a zero in front. If you store it as a string, you keep both characters in order.
On the same screen, you're entering runner zero four. The race ID must keep the zero at the front when you store it. Pick the option that keeps both digits in order.
Compare False on the left with ‘False’ in quotation marks on the right. On the left, the Boolean value tells you the runner hasn't finished. On the right, the quotation marks show that the five letters are stored as text. You can't use that string directly as a Boolean value.
A Paper One question might ask you to state a suitable data type for each value. For the lane letter C, choose character. For the name Aisha Khan, choose string. Read the last two rows carefully: False is Boolean, while ‘False’ in quotation marks is a string.