Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Programming Problem Write a C++ program with functions to help you balance your

ID: 3633277 • Letter: P

Question

Programming Problem

Write a C++ program with functions
to help you balance your chequing account. The program should let you
enter the initial balance for the month, followed by a series of transactions.
For each transaction entered, the program should echo print the
transaction data, the current balance for the account, and the
total service changes. Service charges are $0.10 for a deposit
and $0.15 for a cheque. If the balance drops below $500.00 at any point
during the month, a service charge of $5.00 is assessed for the month.
If the balance drops below $50.00, the program should print a
warning message. If the balance becomes negative, an additional
service charge of $10.00 should be assessed for each cheque until
the balance becomes positive again.
A transaction takes the form of a letter, followed by a blank
and a float number. If the letter is a C, then the number is the amount
of a cheque. If the letter is a D, then the number is the amount
of a deposit. The last transaction consists of the letter E, with
no number following it. A sample run might look like this:

Enter the beginning balance:
879.46
Enter a transaction:
C 400.00
Transaction: Cheque in amount of $400.00
Current balance: $479.46
Service charge: Cheque - $0.15
Service charge: Below $500 - $5.00
Total service charges: $5.15
Enter a transaction:
D 100.0
Transaction: Deposit in amount of $100.00
Current balance: $579.46
Service charge: Deposit - $0.10
Total service charges: $5.25
Enter a transaction:
E
Transaction: End
Current balance: $579.46
Total service charges: $5.25
Final balance: $574.21

Include one void function, called GetInitialBalance,
that obtains the initial balance for the main function.
Include one void function, called GetTransaction,
that obtains the type of transaction and the amount.

your program should use proper style and indentation,
meaningful identifiers, and appropriate comments. Also, be sure
to check for data errors such as invalid transaction codes
or negative amounts.

In order to demonstrate that your program works, you must collect the output
as a script (obtained on hercules with the script program).

Explanation / Answer

#include #include using namespace std; void GetInitialBalance(double&); void GetTransaction(char&, double&); int main () {double balance,amount,fee=0; char type; bool given=false; GetInitialBalance(balance); GetTransaction(type,amount); cout