
Originally Posted by
harold
Hey everyone,
Need a lot of help on this one...this is for a computer class I'm taking and I have to write a program. I wrote it, it works, BUT my math definitely wrong. Can someone help me by posting the various scenarios listed below? The variables that are need are: minimum balance, current balance, interest1,2,3.
Also, the savings account part should have two possibilities, and the checking should (I think) have three.
HELP!!!!!
A bank in your town updates its customers' accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customer balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows:
a) Savings accounts receive 4% interest.
b) Checking accounts with balances of up to $5000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%
If I understand this correctly I think the following covers what you describe:
Code:
function EndOfMonthProc(balance, type, MinBalance)
if type==savings
if balance<MinBalance
newbalance=balance-10;
else
newbalance=1.04*balance;
endif
endif
if type==checking
if balance<MinBalance
newbalance=balance-25;
else
if balance<MinBalance+5000
newbalance=1.03*balance;
else
newbalance=1.05*balance;
endif
endif
endif
return newbalance
endfunction Though I have my doubts about the interest rates, I would have thought they
should be annual rates paid monthly in which they should be:
1+0.04/12, 1+0.03/12, and 1+0.05/12.
RonL