exam questions

Exam FC0-U61 All Questions

View all questions & answers for the FC0-U61 exam

Exam FC0-U61 topic 1 question 123 discussion

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

A global variable called `age` will be created in a program and incremented through the use of a function. Which of the following data types should be defined with the age variable?

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

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
fcc_class
2 months ago
Selected Answer: A
A. Integer Explanation: Since the age variable represents a countable number (e.g., 25 years old, 30 years old) and will be incremented, it should be defined as an integer. Integers are whole numbers and do not require decimal precision, making them the most suitable data type for this scenario. Why the other options are incorrect: B. Float → Used for numbers with decimal points, but age is typically represented as a whole number (e.g., 25, not 25.5). C. Double → Similar to float but with higher precision, which is unnecessary for an integer value like age. D. String → A string stores text, but age is a numeric value that needs to be incremented, making a string unsuitable. Conclusion: Since age is a whole number that will be incremented, Integer (A) is the most appropriate data type. ✅
upvoted 1 times
...
Garra
9 months ago
Since it is being incremented and the information does not specify storing an individual's age in something like a database the answer should be A.
upvoted 1 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