Count who passed — Software Developer · Pretender
A teacher using the fictional Byte & Acorn quiz app wants to know how many students reached the pass mark. The function is almost ready, but three pieces are missing. Fill the blanks so every check passes.
Code checks · ~4 min
Your role
You're the developer (in this game).
Your goal
Fill the blanks so every check passes.
What you know
- Reaching the pass mark exactly also counts as passing.
Limits
- An empty class must give 0, not an error.
Success looks like
- Right start — The counter starts at zero.
- Right comparison — You included scores equal to the pass mark.
- Counts one by one — Each student who passes adds exactly one.
Skills you used
- Logical thinking — Following steps and rules precisely.
- Debugging — Finding what's wrong and why.
In real life
Counting things that meet a condition is one of the most common patterns in programming — from counting unread messages to finding products that are in stock.
Software Developer
Build the apps and tools people use every day.
Explore next
- Game Designer — Invent rules and levels that are fun and fair.
- Data Analyst — Turn numbers into honest answers.
- Cybersecurity Analyst — Protect people and systems from online threats.
Keep exploring
Other languages
Loading MyLeoNes™…