•String
accountName = atm.readWord
• ("Account name: " );
•char
accountType = atm.readChar
• ("Check/Fee/Reg/Sav?
(c/f/r/s): " );
•int
start = atm.readInt("Initial deposit: " );
•BankAccount
newAccount;
•switch( accountType ) {
• case 'c': newAccount = new CA( bal, this );
• break;
• case 'f': newAccount = new FA( bal, this );
• break;
• default:
atm.println
• ("invalid account type:
" + accountType);
•
return;
•}