exam questions

Exam FC0-U61 All Questions

View all questions & answers for the FC0-U61 exam

Exam FC0-U61 topic 1 question 63 discussion

Actual exam question from CompTIA's FC0-U61
Question #: 63
Topic #: 1
[All FC0-U61 Questions]

Which of the following data types should a developer use when creating a variable to hold a postal code?

  • A. Integer
  • B. String
  • C. Float
  • D. Boolean
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
yanis88
9 months ago
Selected Answer: B
I've seen a lot of confusion in the comments here, but we need to think out of the box! Some countries use only numbers for postcodes, whilst others a combination of letters/characters and numbers (i.e. UK). If your database is only used for a specific area that only a certain type of postcodes is used (e.g. number) you can use integers and throw a warning if the field is of a different type OR go with string types and simply cast/convert to integer (if that conversion fails --> it's not only numbers). String so that we cover all different cases
upvoted 4 times
...
Idkhelpme
1 year, 2 months ago
U learn something new everyday. Didn't even know postal codes could have - and letters.
upvoted 4 times
...
Amycert
1 year, 4 months ago
Selected Answer: B
string, because of the "-" character
upvoted 2 times
...
Theasianmushroom
2 years, 5 months ago
It should be a string because you wouldn't need to use the numbers inside of the postal code for computation, so a string format would be more efficient
upvoted 2 times
...
FaisalJ
2 years, 9 months ago
B. String A postal code (also known locally in various English-speaking countries throughout the world as a postcode, post code, PIN or ZIP Code) is a series of letters or digits or both
upvoted 2 times
...
trickerk
2 years, 11 months ago
String is correct because some postal codes starts with zeros.
upvoted 2 times
...
Dirkster
2 years, 11 months ago
B is correct. an integer is used in calculations. Even though a postal code is a number, it's used as text(string) to ID a location, and not used in maths.
upvoted 4 times
...
CyberChic
2 years, 11 months ago
It should be integer. Not a string.
upvoted 2 times
urnaflipflop
1 year, 2 months ago
some postal codes start with 0 and integer wouldn't read the 0
upvoted 1 times
...
...
yosana
3 years ago
it should be A I think,
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago