The Bank of West provides a customer with a checking and savings account. For both checking and saving accounts each, a free checkbook is issued to the customer.  


Write a program to calculate the monthly fees a customer should be charged for maintenance and using services of both the checkings and the savings account.


  • The number of checks written against the Checking Account.
  • The checkings account balance at the end of the month.
  • The savings account balance at the end of the month.
  • The number of checks written against the Savings Account.


  • The monthly fee to charge for account maintenance and services used.


  •  The account balances used provided as input is rounded off nearest whole number.


A customer is charged a flat monthly fee of $10 for maintenance of the checking account irrespective of the balance of the checking account. Whereas no fees are charged for maintenance of savings account as long as a minimum balance (>= $5,000) is maintained in both the accounts combined else is charged $10  monthly fee for saving accounts. 

Depending on the number of checks written against the checking account a certain fee is calculated. Whereas in case of savings account, the first N (N=5) checks in the month incur no fee but afterward for each check issued, a $0.25 per check fee is accessed.

The fees for checking the account for the number of the checks issued in the month is calculated as follows:

No of checks
Fees in cents
less than equal to 20 checks20¢ per check
less than equal to 30 checks
15¢ per check
less than equal to 50 checks
10¢ per check
more than 50 checks5¢ per check

Test cases

(Checking Balance)
(Checking Checks Issued)
(Savings Balance)
(Savings Checks Issued)
Command-Line InputOutput
20000500032000 0 5000 310.00
200015200002000 15 4000 023.00
200040350052000 40 3500 514.00
3000101000103000 10 1000 1033.25
500060600055000 60 6000 513.00


  • Accept the four whole numbers as input via the command line arguments. 
  • The inputs are in the following order: Checking Balance, Checking Checks Issued, Savings Balance, Savings Checks Issued.
  • Write the logic to compute the monthly fees.
  • Display the monthly fees formatted and rounded to two decimal places.