A bank in your town updates its customers\' accounts at the tend ofeach month. T
ID: 3614000 • Letter: A
Question
A bank in your town updates its customers' accounts at the tend ofeach month. The bank offers two types of accounts: savings andchecking. Every customer must maintain a minimum balance. If acustomer's balance falls below the minimum balance, there is aservice charge of $10.00 for savings accounts and $25.00 forchecking accounts. If the balance at the end of the month is atleast the minimum balance, the account receives interest asfollows:a. Savings account receive 4% interest.
b. Checking accounts with balances of up to $5000 more than theminimum balance receive 3% interest; otherwise, the interest is5%
Write a program that reads a customer's account number (int type),account type ( char type; s or S for savings, c or C for checking),minimum balance that the account should maintain and currentbalance. The program should then output the account number, accounttype, current balance, and an appropriate message. Test yourprogram by running it five time using following data:
46728 S 1000 2700
87324 C 1500 7689
79873 S 1000 800
89832 C 2000 3000
98322 C 1000 750
Explanation / Answer
please rate - thanks import java.util.*; public class untitled1 { public static void main (String [] args) {int num,error=1,itype=0; char type; double min,cur,rate=0; Scanner in=new Scanner(System.in); System.out.println("Enter account number: "); num=in.nextInt(); while(error==1) { System.out.println("Enter account type(s-savings or c-checking):"); type=in.next().charAt(0); if(type=='c'||type=='C') {itype=1; error=0; rate=3/100.; } else if(type=='s'||type=='S') {itype=0; error=0; rate=4/100.; } if(error==1) System.out.println("Invalid type-re enter"); } System.out.println("Enter minimum balance: "); min=in.nextDouble(); System.out.println("Enter current balance: "); cur=in.nextDouble(); if(itype==1) { if(cur>min+5000) rate=5/100.; else if(curRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.