import java.util.Scanner; import java.text.NumberFormat; import java.util.Locale; /** * This ATM class simulates the workings of a personal ATM. * * @author YOUR NAME * @version v100 */ public class ATM {//atm /** *

Deposit Funds to an Account

*

* This routine adds a dollar amount to the current balance in the account. *

* This method takes the amount given and adds it to the current balance. *

* @param amount is the amount in dollars being deposited * @param currentBalance is the starting balance before the deposit * @return the new balance including the deposit */ static public double deposit(double amount, double currentBalance) { return newBalance; } /** *

Adding Interest to an Account

*/ static public double addInterest(double currentBalance) { return newBalance; } /** *

Account Withdrawals

*/ static public double withdrawal(double amount, double currentBalance) { return newBalance; } /** *

showAsDollars

*

* This routine formats the argument to look like dollars. *

* This method accepts a double dollar amount and returns a string which is * formatted to look like dollars. *

* @param amount is the pre-formatted dollar amount (e.g. 100.0) * @return a string which is formatted to look like dollars (e.g. $100.00) */ public static String showAsDollars(double amount) { NumberFormat format = NumberFormat.getCurrencyInstance(Locale.CANADA); String currency = format.format(amount); return currency; } public static void main(String[] args) {//main //declarations int numTransactions = 0; double amount = 0.00; double balance = 0.00; double interestAmount = 0.00; double prevBalance = 0.00; String str = ""; String option = ""; Scanner keybd = new Scanner(System.in); //continue until "L" is entered while (true) { if (option.equals("L")) { System.out.println("Thank you, logging out."); break; } } }//main }//atm