FC0-U71 Software Development Concepts Practice Question
A junior developer writes a program that stores a customer's age in a variable. The value should be a whole number between 0 and 120. Which data type is most appropriate for this variable?
⚠ Common exam trap
The trap here is choosing a float because it can hold whole numbers, overlooking that ages are discrete integers and floats permit meaningless fractional values.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Integer
The variable must hold a whole number representing age within a defined range, so an integer is the natural fit. It allows numeric comparisons and arithmetic without the overhead or ambiguity of text or fractional types. String, Boolean, and float either cannot represent the value correctly or introduce unnecessary complexity and invalid possibilities.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Float
Why it's wrong here
A float can store numbers with decimal points, such as 25.5, which is unnecessary for an age and can introduce rounding issues. Ages are whole numbers, so using a float would allow invalid fractional values and waste precision. While it could technically hold 25.0, it is not the most appropriate type for an integer age range.
- ✗
String
Why it's wrong here
A string stores text characters and would allow values like 'twenty' or 'abc', which cannot be compared or used in arithmetic without conversion. While a string could hold digits, it is not the natural type for a numeric age and would complicate validation and calculations. The scenario calls for a whole number, so a string is not the most appropriate choice.
- ✓
Integer
Why this is correct
An integer stores whole numbers without decimal places, which perfectly matches an age value between 0 and 120. It supports arithmetic and comparison operations needed for validation, and it prevents fractional values that would be meaningless for age. This makes integer the most natural and appropriate data type for the described variable.
- ✗
Boolean
Why it's wrong here
A Boolean can hold only true or false, which cannot represent an age value like 25 or 40. Using a Boolean here would lose all numeric information and make range checks impossible. Since the requirement is a whole number between 0 and 120, Boolean is clearly unsuitable and would fail the intended purpose of the variable.
Go deeper
Related to this question
About these practice questions
Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.