Anyone can help me about this question c++

I need some help to introduce more detail about this question to make code for c++ programming. I think this question will used switchcase to make the code right ? anyone can explain me more detail ? Thank you. The question is:

There are two bank accounts: current and savings. First, ask the initial balance on the bank account, reject negative balance. Then ask for the transactions: option are deposit, withdrawal and transfer. Then ask for the account; option are current and savings. Then ask for the amount, reject transaction that overdrawn an account. At the end, print the balances of both accounts.
closed account (o3hC5Di1)
Hi there,

Let's break it down:

There are two bank accounts: current and savings.

So you will need 2 variables: one to store the balance in the current account and one to store the balance of the savings account.

First, ask the initial balance on the bank account, reject negative balance.

You will need to show a message on the screen asking the user for the initial balance and store it in another variable. If the number entered by the user was negative, you should repeat the question.

Then ask for the transactions: option are deposit, withdrawal and transfer.
Ask the user whether he wants to do Deposit, Withdrawal or Transfer. As you mentioned, a swtich statement would be a good option to check which value the user entered.

Then ask for the account; option are current and savings

Same as the previous, pretty much.

Then ask for the amount, reject transaction that overdrawn an account.
Ask the user the amount, if it is higher than the amount in the account, reject it.

At the end, print [to the screen] the balances of both accounts.



If you read that well you should have all the info you need to get started. If you need any further help please do get back to us with your attempted code.

All the best,
NwN
Last edited on
Hi NwN,

thanks for reply it. but the problem for me is, i still new in the programming c++. So, I do not know where it wanted to start doing coding for an answer to this question. Are you able to help me a bit in making the coding?

May be i need use switchcase to doing this coding, right ?

Thanks
closed account (o3hC5Di1)
Hi there,

If you are getting this assignment I assume your teacher has taught you:

- To use variables
- To print output to the screen and receive output from the user
- To use conditional statements like if/else or switch
- To use loops like for or (do/) while.

My last post comes as close to giving you the solution without actually writing the code myself.

Let's try the first two objectives first:

There are two bank accounts: current and savings. - So you will need 2 variables: one to store the balance in the current account and one to store the balance of the savings account.

First, ask the initial balance on the bank account, reject negative balance. - You will need to show a message on the screen asking the user for the initial balance and store it in another variable. If the number entered by the user was negative, you should repeat the question.


You will need following information:

http://www.cplusplus.com/doc/tutorial/program_structure/
http://www.cplusplus.com/doc/tutorial/variables/
http://www.cplusplus.com/doc/tutorial/basic_io/
http://www.cplusplus.com/doc/tutorial/control/

Please try a fair attempt yourself first. If you have any further questions or doubts, do not hesitate to ask.

All the best,
NwN
I try to make the coding. And can you fix if any error i found ?

Thanks
closed account (o3hC5Di1)
Yes, just make sure to share your code and any error messages you get.

All the best,
NwN
Topic archived. No new replies allowed.