This is a program that works like a bank account. It has the deposit, withdrawal, and transaction. But, I have troubles doing the transaction part of the program. I need a method named transaction to help a local banker, and the method needs to utilize TWO input parameters and the method’s return value (for its output).
It should satisfy the following specification: – a method named transaction which takes : ∗ a customer’s current balance ∗ the amount of money to update the account by : · a positive dollar amount is a deposit · a negative dollar amount is a withdraw as input parameters, and then returns ∗ for deposits: the deposit amount is simply returned by the function. ∗ for withdraws: the balance must not become negative. If a withdraw is requested for more than the current balance then the amount (which would zero the balance if withdrawn) is returned by the method. Otherwise, the withdrawn amount is simply returned by the method.
This is the program I have so far(without the transaction method):
Thank you
It should satisfy the following specification: – a method named transaction which takes : ∗ a customer’s current balance ∗ the amount of money to update the account by : · a positive dollar amount is a deposit · a negative dollar amount is a withdraw as input parameters, and then returns ∗ for deposits: the deposit amount is simply returned by the function. ∗ for withdraws: the balance must not become negative. If a withdraw is requested for more than the current balance then the amount (which would zero the balance if withdrawn) is returned by the method. Otherwise, the withdrawn amount is simply returned by the method.
This is the program I have so far(without the transaction method):
Thank you