nerdexam
CompTIA

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…

Hardware

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)
  • A
    3% (1)
  • B
    86% (30)
  • C
    9% (3)
  • D
    3% (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

#string variable#data types#scripting#programming basics

Community Discussion

No community discussion yet for this question.

Full 220-1002 Practice