Practice question · Sort into groups
Passing is a score of 50 or more. Sort each score by whether it passes or fails.
Groups: Passes · Fails
- 50
- 0
- 49
- 51
- 30
- 100
Hints
- The rule is 50 or more, so 50 itself passes.
- 49 is below the boundary and fails; 50 meets it and passes.
Show the answer
Passes: 50, 51, 100
Fails: 49, 30, 0
Why
Everything at least 50 passes: 50, 51 and 100. Below 50 fails: 49, 30 and 0. The 49-versus-50 pair is the boundary the task warns about, whether the test is >= 50 or > 50 decides the fate of exactly the score 50.
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 program that counts passing scores needs a loop, a conditional and an accumulator, and removing any one of…
- A beginner writes a working program and cannot explain why it works. Why is that a problem even though the…