Last active
August 29, 2015 14:02
-
-
Save drobbins/8595f302d7225dfe7ac7 to your computer and use it in GitHub Desktop.
ATM Machine
This file contains hidden or 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 AtmMachine { | |
Account[] accounts; | |
public static void main(String[] args) { | |
int command; | |
int id; | |
for (int i=0; i<10; i++) { | |
accounts[i] = new Account(100); | |
} | |
while (true) { | |
// Ask for and get the account id to work on.. | |
if (id > 9) { | |
// Invalid ID, ask for a new one.. | |
} else { | |
// Ask for and get the command.. | |
while (command != 4) { | |
if (command == 1) { | |
printBalance(id); | |
} else if ( command == 2) { | |
withdrawal(id); | |
} else if ( command == 3) { | |
deposit(id); | |
} | |
// Ask for and get a new command... | |
} | |
} | |
} | |
} | |
public void printBalance(int id) { | |
} | |
public void withdrawal(int id) { | |
} | |
public void deposit(int id) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment