Datasets:

ArXiv:
License:
denisko's picture
cnanged dir structure and removed features file
3e77472
raw
history blame contribute delete
620 Bytes
package isufficientbalanceexception;
/**
*
* @author DeLL
*/
public class BankAccount {
double amount;
BankAccount(){
amount=0.0;
}
void deposit(double amt){
amount+=amt;
}
void Withdraw(double wa) throws MyException{
if(amount>=wa){
System.out.println("Withdrawn successful!! Remaining balance is:"+(amount-=wa));
}
else{
double amtrequired=wa-amount;
throw new MyException("Insufficient balance!! your account has"+amtrequired+" rupees less than you want to withdraw!");
}
}
}