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.  

Program

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.

Input

  • 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.

Output 

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

Assumptions

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

Requirement

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

No
Input
(Checking Balance)
Input
(Checking Checks Issued)
Input 
(Savings Balance)
Input
(Savings Checks Issued)
Command-Line InputOutput
 (Fees)
1
20000500032000 0 5000 310.00
2
200015200002000 15 4000 023.00
3
200040350052000 40 3500 514.00
4
3000101000103000 10 1000 1033.25
5
500060600055000 60 6000 513.00

Instructions 

  • 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.