Courseiva

FC0-U71 Applications and Software Practice Question

A programmer declares a variable 'price' and assigns it the value 19.99. In most programming languages, what is the data type of this variable?

⚠ Common exam trap

The trap is confusing float with double or assuming that a decimal literal might be an integer if it ends in .0; the exam tests recognition that any number with a decimal point is a floating-point type by default.

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

✓

Float

The value 19.99 contains a decimal point, which indicates a floating-point number. In most programming languages, such as Python, Java, C, and JavaScript, a numeric literal with a decimal point is treated as a float (or double) by default. Therefore, the data type of the variable 'price' is float.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Boolean

    Why it's wrong here

    Boolean holds only true or false, so it cannot store 19.99. It is tempting because flags and conditions use Booleans, and a price could theoretically be represented as a validity flag, but the literal 19.99 is a fractional numeric value, which most languages type as a floating-point number.

  • ✓

    Float

    Why this is correct

    19.99 contains a fractional part, so most languages infer a floating-point type rather than an integer. Float stores real numbers with decimal precision, satisfying the stem's assignment of a decimal literal to the variable price.

  • ✗

    String

    Why it's wrong here

    A string stores text characters, so 19.99 would be typed as a floating-point number, not a string, unless explicitly quoted. It is tempting because input from users often arrives as text, but the stem assigns a numeric literal directly, which most languages infer as a floating-point type.

  • ✗

    Integer

    Why it's wrong here

    Integer types hold whole numbers only, so 19.99's fractional part cannot be represented without truncation or rounding. It is tempting because prices are numeric, but the decimal point makes this a floating-point literal in most languages, and integer assignment would lose precision.

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 →

How Courseiva writes practice questions · Editorial policy

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.