Write the entire class SafetyChecking. SafetyCheck Account has nomonthly fee, pa
ID: 3612908 • Letter: W
Question
Write the entire class SafetyChecking. SafetyCheck Account has nomonthly fee, pays no interest, and has a creditlimit. As long as a withdrawal (i.e. a check) willnot make the balance more negative than the account's credit limit,the check is honored. The usual Check-Bounce Fee applies when acheck is not honored, and a smaller Credit Fee ischarged each time a check results in a negative balance. This a home work problem. Thanks!! Write the entire class SafetyChecking. SafetyCheck Account has nomonthly fee, pays no interest, and has a creditlimit. As long as a withdrawal (i.e. a check) willnot make the balance more negative than the account's credit limit,the check is honored. The usual Check-Bounce Fee applies when acheck is not honored, and a smaller Credit Fee ischarged each time a check results in a negative balance. This a home work problem. Thanks!! This a home work problem. Thanks!!Explanation / Answer
import java.util.Scanner;
publicclass check
{
privatestatic double ToWithdraw,CurrentBalance,NewBalance,CreditLimit,BounceFee;
publicstatic voidmain(String[] a)
{
CurrentBalance = 375.00;
CreditLimit =500;
BounceFee =45.00;
System.out.println("Enter the amount you want towithdraw");
Scanner s =new Scanner(System.in);
ToWithdraw =s.nextInt();
if(ToWithdraw >= CreditLimit && ToWithdraw>= CurrentBalance){
System.out.println("You have exceeded your balance & creditlimit");
}else{
NewBalance = CurrentBalance - ToWithdraw;
System.out.println("you new balance is: " + "$" + NewBalance +" "+ "your creditlimit is: " +"$"+CreditLimit);
//you can add a statement to compute the creditlimit when balance goes negative another:
//if(NewBalance < 0){
//CreditLimit = NewBalance -CreditLimit
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.