withdraw and deposit
Sat Aug 14 2021 03:23:08 GMT+0000 (Coordinated Universal Time)
Saved by
@Gold
// withdraw
function withdraw(balance,n){
// initialize balance to zero
balance = 2000;
if(n < balance){
balance = balance - n ;
}
else if(n > balance){
alert("INSUFFICIENT FUNDS");
}
else{
confirm('are you sure you would like to withdraw all you funds from this account?');
balance = null
}
console.log(balance);
};
withdraw(2000,1900);
function deposit(balance,n){
balance = 0;
if (n != 0 ){
balance = balance + n ;
}
else{
alert('please enter a valid deposit');
}
console.log(balance);
}
deposit(0,100)
content_copyCOPY
Comments