Created
May 13, 2019 13:32
-
-
Save BetterProgramming/65cd4ec01da31dd230d0bc35ae941f85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see repo for full code | |
boolean milk; | |
boolean soy; | |
boolean mocha; | |
boolean whip; | |
// and their getters and setters | |
public int cost() { | |
int total = 0; | |
if (isMilk()) { | |
total += MILK_COST; | |
} | |
if (isSoy()) { | |
total += SOY_COST; | |
} | |
if (isMocha()) { | |
total += MOCHA_COST; | |
} | |
if (isWhip()) { | |
total += WHIP_COST; | |
} | |
return total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment