Curriculum

Curriculum

Pick a Type for a Value

Scenario

The schedule stores a room ID, an available seat count, and whether the room is open.

Selected choicePick a choice below
Result—

Try it yourself

Choose a field and predict which representation fits.

Reveal the explanation
  1. Room ID “007”

    Use text. The leading zeros are part of the identifier.

  2. Free seat count 7

    Use an integer. A bookable seat is counted whole.

  3. 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.