exp3java
exp3java
Data members:
Name of depositor
Account number
Type of account
Methods
to deposit an amount
INPUT
package test;
{
this.name=name;
this.accountNumber=accountNumber;
this.accountType=accountType;
this.balance=balance;
if(amount>0){
balance+=amount;
else{
if(amount>0){
if(balance>=amount){
balance-=amount;
}else{
System.out.println("Insufficient funds.");
}else{
}
}
account1.displayAccount();
account1.deposit(1500);
account1.withdraw(2100);
account1.withdraw(12000);
account1.displayAccount();
OUTPUT