Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static void main(String [] args)
{
BankAcount b = new BankAcount( "Bob" , 100.00 );
b.applyOneMonthInterest();
System.out.println();
System.out.println();
b.withdraw(30.25);
System.out.println();
System.out.println();
b.applyInterest(6);
System.out.println();
System.out.println();
b.deposit(229.40);
System.out.println();
System.out.println();
b.withdraw(10000.0);
System.out.println();
System.out.println();
b.deposit(-10.25);
System.out.println();
System.out.println();
b.withdraw(-10.25);
System.out.println();
System.out.println();
b.printStatement();
}
Output:
Welcome to the bank Bob your balance is: 100.0
After applying interest for one month
Your new balanace is: 100.42
After withdrawing:30.25
Your new balanace is: 70.17
After applying interest for 6 months
Your Current balance is : 71.94
After depositing: 229.4
Your new balanace is:301.34
After withdrawing:10000.0
Insufficient: You only have 301.34 in your account.
Your new balanace is: 301.34
After depositing: -10.25
You can only deposit a positive number.
Your new balanace is:301.34
After withdrawing:-10.25
You can only withdraw a positive amount!
Your new balanace is: 301.34
CIS 162 Bank Account Summary
**********************************
Balanace: 301.34
Customer: Bob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment