DA0-001 · Question #79
Which of the following data types would a telephone number formatted as XXX-XXX-XXXX be considered?
The correct answer is D. Text. A telephone number formatted with hyphens is considered a text data type because it is composed of alphanumeric characters and symbols, and it is not intended for mathematical operations.
Question
Which of the following data types would a telephone number formatted as XXX-XXX-XXXX be considered?
Options
- ANumeric
- BDate
- CFloat
- DText
How the community answered
(64 responses)- A6% (4)
- B5% (3)
- C2% (1)
- D88% (56)
Why each option
A telephone number formatted with hyphens is considered a text data type because it is composed of alphanumeric characters and symbols, and it is not intended for mathematical operations.
While composed primarily of digits, the inclusion of hyphens means it's not purely numeric; more importantly, telephone numbers are not used in mathematical operations like addition or averaging.
A telephone number has no relation to a date or time value.
Float is a numeric data type used for storing decimal numbers, which is inappropriate for a phone number that is not used in calculations and may contain non-numeric characters.
A telephone number formatted as XXX-XXX-XXXX contains hyphens, which are non-numeric characters, making it unsuitable for mathematical calculations. Therefore, it is best stored and treated as a text or string data type to preserve its exact format and character sequence.
Concept tested: Data type identification (text vs. numeric)
Source: https://learn.microsoft.com/en-us/training/modules/csharp-define-data-types/3-numeric-non-numeric-data-types
Topics
Community Discussion
No community discussion yet for this question.