220-1002 · Question #357
Which of the following variable types should be used to store the data "Chicago" within a script or code?
The correct answer is B. String. A String is the data type used to store text - any sequence of characters, including letters, spaces, punctuation, and numbers treated as text. 'Chicago' is a city name composed of alphabetic characters with no numeric or logical value, making String the correct type. An…
Question
Which of the following variable types should be used to store the data "Chicago" within a script or code?
Options
- AInteger
- BString
- CBoolean
- DFloat
How the community answered
(35 responses)- A3% (1)
- B86% (30)
- C9% (3)
- D3% (1)
Explanation
A String is the data type used to store text - any sequence of characters, including letters, spaces, punctuation, and numbers treated as text. 'Chicago' is a city name composed of alphabetic characters with no numeric or logical value, making String the correct type. An Integer stores whole numbers (e.g., 42). A Boolean stores only two values: true or false. A Float stores decimal numbers (e.g., 3.14). Since 'Chicago' is purely textual data, it must be stored as a String.
Topics
Community Discussion
No community discussion yet for this question.