Earthquakes: Programming and Interfaces :Java Programming: Principles of Software Design (Java Programming and Software Engineering Fundamentals Specialization) Anawers 2025
1. Depth between -12,000.0 and -10,000.0 (exclusive)
✔️ 18
2. Depth between -4000.0 and -2000.0 (exclusive)
✔️ 136
3. Phrase “Quarry Blast” at the start
✔️ 44 quakes
4. Phrase “Alaska” at the end
✔️ 14 quakes
5. Phrase “Can” anywhere
✔️ 3 quakes
6. Magnitude of the 20th largest earthquake
✔️ 6.1
7. Country of the 50th largest earthquake
✔️ Japan ✔️ ❌ Indonesia ❌ Greece ❌ Solomon Islands ❌ Kyrgyzstan
8. Within 1,000 km of Denver AND title ends with “a”
✔️ 2 quakes
9. Magnitude 3.5–4.5 & depth -55,000 to -20,000 (inclusive)
✔️ 22 quakes
10. Mag 1.0–4.0, depth -180,000 to -30,000, title contains “o”
✔️ 38 quakes
11. Mag 0.0–5.0, within 3000 km of Billund, title contains “e”
✔️ 52 quakes
12. Why “null” printed instead of “Distance”?
✔️ In the DistanceFromFilter constructor, the name variable was not assigned. ❌ getName error in MatchAllFilter ❌ getName missing ❌ EarthQuakeClient2 logic error
📘 Summary Table
Q#
Correct Answer
1
18
2
136
3
44
4
14
5
3
6
6.1
7
Japan
8
2
9
22
10
38
11
52
12
Name variable not assigned in DistanceFromFilter constructor