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
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. ✅
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
...
This section is not available anymore. Please use the main Exam Page.FC0-U61 Exam Questions
Log in to ExamTopics
Sign in:
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.
fcc_class
2 months agoGarra
9 months ago