Kotlinlearncs.online LogoJava
Return to List

Solve: Drop Bear Safety

Created By: Geoffrey Challen
/ Version: 2026.2.0

The drop bear is a fearsome creature from Australian folklore -- a large, carnivorous koala that drops from trees onto unsuspecting tourists. (Don't worry, they're not real... probably.)

Create a function called dropBearDanger that accepts three Boolean parameters:

  • hasVegemite: whether you have Vegemite behind your ears (a well-known drop bear repellent)
  • underEucalyptus: whether you are standing under a eucalyptus tree
  • isNighttime: whether it is nighttime

Return a String indicating your danger level:

  • If hasVegemite is true, return "Safe" -- Vegemite always protects you, regardless of other conditions.
  • If underEucalyptus and isNighttime are both true, return "Extreme danger!".
  • If either underEucalyptus or isNighttime is true (but not both), return "Moderate danger".
  • Otherwise, return "Low danger".

Related Lessons

Stuck? You may find these lessons helpful:

Report a Problem

Attribution must link to this page: https://www.learncs.online/solve/kotlin/drop-bear-safety/[email protected]