Practice question · True or false
A program that counts passing scores needs a loop, a conditional and an accumulator, and removing any one of the three breaks it.
Hints
- Each does a job the others cannot.
- Visit, test, remember.
Show the answer
True
Why
True. The loop visits every score, the conditional decides which count, and the accumulator remembers the running total across iterations. They are the three primitives most simple data processing reduces to, and recognising that shape is what makes an unfamiliar task tractable.
Practise Integrated Introductory Programming Practice
The app has 5 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Integrated Introductory Programming Practice
- Select every input that should be in the test suite for the passing-and-average task.
- Order the structured approach to the task: read a list of exam scores and report how many passed and the…
- A beginner writes a working program and cannot explain why it works. Why is that a problem even though the…
- Passing is a score of 50 or more. Sort each score by whether it passes or fails.