Skip to content

Instantly share code, notes, and snippets.

@StevenMeiklejohn
Created September 5, 2017 13:04
Show Gist options
  • Save StevenMeiklejohn/2bc94c49fdebfabe2b2edeefd89a4ecf to your computer and use it in GitHub Desktop.
Save StevenMeiklejohn/2bc94c49fdebfabe2b2edeefd89a4ecf to your computer and use it in GitHub Desktop.

Task

Go and write tests for the rest of the methods in the Robot class, and them implement them:

  • double checkBattery()
    • returns percentage of battery life left
  • String makeDrink (String drink)
    • passes in the name of the drink being made e.g. tea
    • uses up 10% of the battery life
    • returns the string "I am making" + drink
  • String washDishes()
    • uses up 30% of battery life
    • returns the string "I am washing the dishes"
  • String doDusting()
    • uses up 20% of the battery life
    • returns the string "I am dusting"
  • void rechargeBattery()
    • resets battery to 100.0

[i]: remember the delta when comparing floating point numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment