Skip to content

Instantly share code, notes, and snippets.

@zimmertr
Created January 8, 2017 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zimmertr/73b3be2a80c9e6f6817e89a199bb76b3 to your computer and use it in GitHub Desktop.
Save zimmertr/73b3be2a80c9e6f6817e89a199bb76b3 to your computer and use it in GitHub Desktop.
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