Skip to content

Instantly share code, notes, and snippets.

@drobbins
Last active August 29, 2015 14:02
Show Gist options
  • Save drobbins/8595f302d7225dfe7ac7 to your computer and use it in GitHub Desktop.
Save drobbins/8595f302d7225dfe7ac7 to your computer and use it in GitHub Desktop.
ATM Machine
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