Pick a Type for a Value
Scenario
The schedule stores a room ID, an available seat count, and whether the room is open.
Try it yourself
Choose a field and predict which representation fits.
| Case | Result |
|---|---|
| Room ID “007” | Select a choice above to see what happens. |
| Free seat count 7 | Select a choice above to see what happens. |
| Room open? | Select a choice above to see what happens. |
Reveal the explanation
- Room ID “007”
Use text. The leading zeros are part of the identifier.
- Free seat count 7
Use an integer. A bookable seat is counted whole.
- Room open?
Use a boolean for the yes-or-no state.
A value that looks like a number may still be text. Decide based on how the program will use it.
Your turn
Choose types for room “004,” a count of four seats, and a yes-or-no open flag.
Common mistake Converting room IDs to numbers and losing leading zeros.
Check your work
Text, integer, and boolean, with one reason for each.
This browser could not save your progress. Changes last until you leave the page.