Courseiva
easyMultiple ChoiceObjective-mapped

FC0-U71 Practice Question: A developer writes a script to calculate the…

A developer writes a script to calculate the average of a list of numbers. The script uses a loop to sum the numbers and then divides by the count. Which programming concept does this represent?

⚠ Common exam trap

A common mix-up: candidates confuse 'sequence' (the general order of steps) with 'iteration' (the repeated execution of a block), especially since the script does follow a sequence of steps, but the key distinguishing concept is the loop that repeats the summing operation.

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

Iteration

The script uses a loop to repeatedly access each number in the list and add it to a running total. This repeated execution of a block of code (the loop body) is the defining characteristic of iteration. Iteration is the correct programming concept because the average calculation depends on cycling through a sequence of elements, which is exactly what a loop provides.

Answer analysis

Option-by-option breakdown

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

  • Iteration

    Why this is correct

    Iteration uses loops to repeat actions, as in summing numbers.

  • Selection

    Why it's wrong here

    Selection involves decision-making (if-else), not loops.

  • Recursion

    Why it's wrong here

    Recursion involves a function calling itself, not a simple loop.

  • Sequence

    Why it's wrong here

    Sequence is simply executing instructions in order, but the key here is repetition.

About these practice questions

This FC0-U71 question is part of Courseiva's 988-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.