🏝 Island Logic

Debug & Trace Session
🐞 Bug Tracker
Derived getter
isWinning() threshold
applyBonus overload
IslandScorer.java Java 17 -- bug lines become editable after Reveal

Senior Dev Review

Read the code. Commit to a prediction. Then reveal.

Contestant class
1
Lines 2-3
Before reading further -- what are these two fields responsible for storing? What would happen if they were declared public instead of private?
2
Lines 5-8
The constructor uses this twice. What would happen if you removed both references and wrote name = name and score = score instead?
3
Lines 14-16
This method is supposed to return something like Maya: 50 for a contestant named Maya with a score of 50. What does it actually return? What is wrong, and why does it matter?
🔨 Spot a bug? Fix line 15 in the code panel.
4
Lines 18-20
The winning threshold is 50. A contestant has a score of exactly 50. Does isWinning() return true or false? Why?
🔨 Spot a bug? Fix line 19 in the code panel.
IslandScorer class
5
Line 24
This field belongs to the class, not to any object. What does that mean for how many copies of it exist when you create two Contestant objects?
6
Lines 26-33
Two methods, same name, different parameters. Which one runs when you pass only one argument? What is the return value for a score of 30? Do you see anything else worth flagging?
🔨 Spot a bug? Fix line 31 in the code panel.
main method
7
Lines 36-45
Read through the main method top to bottom. Write out exactly what you think prints to the console, line by line. Account for all three bugs.