Courseiva

FC0-U71 Software Development Concepts Practice Question

A programmer is writing a function that must decide whether a customer qualifies for a discount. The function checks if the customer's total purchases are greater than 500. If true, it returns a discount rate; otherwise, it returns zero. Which programming construct is most appropriate for making this decision?

⚠ Common exam trap

The trap here is overcomplicating a single decision by reaching for iteration or data storage when the scenario only calls for evaluating one condition and choosing between two results.

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

✓

A conditional statement such as if-else.

The requirement is a single decision with two possible outcomes based on whether total purchases exceed 500. A conditional statement such as if-else evaluates the condition and selects the appropriate result. Loops repeat actions, variable declarations store data, and function calls retrieve values, but none of those directly perform the branching decision needed here.

Answer analysis

Option-by-option breakdown

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

  • ✓

    A conditional statement such as if-else.

    Why this is correct

    An if-else statement evaluates a condition and executes one block when the condition is true and another when it is false. Here the condition is whether total purchases exceed 500. If true, the function returns a discount rate; otherwise, it returns zero. This directly implements the required one-time decision between two outcomes.

  • ✗

    A function call that returns the customer's total purchases.

    Why it's wrong here

    Calling a function can retrieve the total purchases value, but it does not decide whether a discount applies. The decision requires comparing that value to a threshold and selecting a result. A function call may supply input to the decision, yet the conditional logic still must be written separately to return either a discount rate or zero.

  • ✗

    A variable declaration that stores the discount rate.

    Why it's wrong here

    Declaring a variable only reserves storage and optionally assigns an initial value. It does not evaluate a condition or choose between outcomes. In this scenario, the programmer needs to compare total purchases to 500 and branch accordingly. A variable declaration may be part of the solution, but by itself it cannot perform the decision logic required.

  • ✗

    A loop that repeats the check until the value changes.

    Why it's wrong here

    A loop repeats a block of code multiple times, which is unnecessary here because the decision depends on a single value. Using a loop would add complexity and could cause repeated evaluations without benefit. The scenario requires one choice between two outcomes based on a condition, so a selection structure is more suitable than iteration.

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 →

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.