Need help for coding!

QUESTION 3
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’s 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 $5,000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%.
Write a program that reads a customer’s account number (int type), account type (char; s for savings, c for checking), minimum balance that the account should maintain, and current balance. The program should then output the account number, account type, current balance, and an appropriate message.

been trying from 5days ago yet i cant find the right coding. Please help.

Can we see the code you've written so far?

So, the program doesn't need to actually calculate the interest to be added to the account then? If the program is required to calculate interest to be applied; (a) how do you determine the elapsed time? (b) is the interest applied to the over that calendar month on the ending balance?
Last edited on
What exactly is the problem ? First you start to get the input using std::cout and std::cin. Next you generate the message and output it together with the input you gathered.

@ajh32
(a) how do you determine the elapsed time? (b) is the interest applied to the over that calendar month on the ending balance?

You think to complicated.
As I understand it the program should only output a message like "you will receive X% interest" or "you have to pay a service charge of $10.00.
You should show the code you have written so far, or at the very least some psuedo code. This way others will know where to help you and point you in the right direction
The program should then output the account number, account type, current balance, and an appropriate message.

I hate assignments like this. What is an "appropriate message?"

"Can I interest you in a credit card?" - from the Bank's perspective, that's the most appropriate message.

"The current balance in your [checking|savings] account is $XYZ."

"If you make no changes, the balance at the end of this month will be $XYZ"

"If you make no changes, the balance at the end of the next 3 months will be $ABC, $DEF and $XYZ"

"If you make no changes, the balance at the end of the year will be $XYZ"

"If you make no changes, the balance after 263 years will be $QRS"

The prof probably wants the second message: what is the balance at the end of the month, after applying the service charge or interest payment.

To solve this, start by writing a program that accepts the input and simply prints out the account type minimum balance and current balance. There won't be any point in writing the code that calculates the new balance if you don't get the input correct.

Then, write a function that calculates the new balance from the account type, the current balance and the minimum balance:
double newBalance(char acctType, double curBalance, double minBalance);

Call this in your main program and adjust the output to print the new also.

Run a few test cases with trivial amounts to see if you have the right results.
Topic archived. No new replies allowed.