Last active
August 29, 2015 13:56
-
-
Save Bjacksonshorts/9091076 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
public class Mom implements Replenishable{ | |
private int bankAccount; | |
public int getCurrentAmount(bankAccount){ | |
// finds out the current anoint in the bank account | |
} | |
public int getFullAmount(bankAccount){ | |
// finds out how much there should be | |
} | |
public boolean isEmpty(){ | |
// returns true if the current amount is 0 | |
// returns false if not | |
} | |
public int replenish(){ | |
// if the current amount eqauls the full amount then it will do nothing | |
// if the current amiunt does not equal the full amount then it will add half of the full amount to the current amount; | |
} | |
} |
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
public class Mom implements Replenishable{ | |
private int bankAccount; | |
public int getCurrentAmount(bankAccount){ | |
// finds out the current anoint in the bank account | |
} | |
public int getFullAmount(bankAccount){ | |
// finds out how much there should be | |
} | |
public boolean isEmpty(){ | |
// returns true if the current amount is 0 | |
// returns false if not | |
} | |
public int replenish(){ | |
// if the current amount eqauls the full amount then it will do nothing | |
// if the current amiunt does not equal the full amount then it will make them equal | |
} | |
} |
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
interface replenishable{ | |
int getAmount(int x); // returns how much of the item there is | |
int getFullAmount(int x); // returns how much of the item there should be | |
boolean isEmpty(); // returns whether or not thre is any more of the item | |
int replenish(); // adds to the amount | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment