The problem I am having right now is finding the correct methods, especially one that allows one token to have one can come out. This is frustrating. Here is my program so far.
Expand|Select|Wrap|Line Numbers
- public class CokeMachine
- {
- int number_tokens;
- int number_cans;
- int token;
- int can;
- public CokeMachine()
- {
- number_cans = 50;
- }
- public void insertToken(int number_tokens)
- {
- token += number_tokens; // takes token, then adds number of tokens to token, then resign it back to token
- }
- }