easyMultiple Choice
FC0-U71 Practice Question: A programmer needs to store a customer's name in…
A programmer needs to store a customer's name in a variable. Which data type is most appropriate?
⚠ Common exam trap
The trap here is that candidates might confuse a customer's name with a numeric identifier (like an ID) and incorrectly choose Integer, but names are inherently textual and require a string data type.
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
✓
String
A customer's name is a sequence of characters (letters, spaces, possibly punctuation), which is best represented as a String data type. In most programming languages, strings are used to store text and are enclosed in quotes (e.g., "John Doe"). This aligns with the fundamental concept that names are not numeric or logical values.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
String
Why this is correct
A customer name is textual data, so String stores the sequence of characters directly. Numeric types such as int or double cannot hold letters, and char holds only a single character, making String the appropriate choice.
- ✗
Float
Why it's wrong here
A float stores IEEE 754 binary approximations of real numbers, so a customer's name cannot be held without loss of precision or type errors. It is tempting because floats suit measurements such as temperatures or prices, where fractional values matter; that scenario, not text storage, is where this data type belongs.
- ✗
Integer
Why it's wrong here
Integer variables hold whole numeric values for arithmetic, so they cannot store alphabetic characters forming a customer name. Integers are correct when counting items, storing quantities or performing calculations where no fractional or textual content is required.
- ✗
Boolean
Why it's wrong here
Boolean variables hold only true or false, so a name string cannot be represented. Booleans are correct for flags and conditions, such as recording whether a customer is active or whether an order has been paid.
Go deeper
Related to this question
About these practice questions
One of 988 original FC0-U71 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.