Explain the empty case
Optional arithmetic and percentage refresher — return to this activity
Write a function, a branch and a loop with explicit input and output.
The placement of a statement determines how often it runs. A fee added inside the loop runs once per row; outside it runs once per order. A return inside the loop can leave later rows unprocessed. Empty input executes the loop zero times, so initialize the accumulator before entering it. Validation and empty-order behavior belong to the contract, not to guesses about what an example probably intended.
Your saved work
Function and branch behavior
No response recorded yet. You can write one in the task workspace.
Loop trace and expected total
No response recorded yet. You can write one in the task workspace.
Empty-input contract and local run
No response recorded yet. You can write one in the task workspace.
Return to your saved taskYour explanation is retained for your review. It is not automatically graded.
Loading saved work… Backups are available in My Learning.