Question: c++ programming project used visual studio. Please help me to make a program code. Bottom is question to make a bank statement. ------------------------------------------------------------------------------------------------------------------------------ Create a
c++ programming project used visual studio.
Please help me to make a program code.
Bottom is question to make a bank statement.
------------------------------------------------------------------------------------------------------------------------------
Create a program which reads a series of bank transactions from a file named TRANSACTIONS.txt and generates a statement report to the screen and also generates a WARNINGS.txt file. If you elect to use a log file name it P4.log
Global constants variables are not allowed. Variables may be declared in main() but use of parameters is expected. Values should be declared as locally as possible to promote function reuse in other programs.
You must use functions of the following names.
You may use other functions as desired. You should determine the parameters (if any) and whether each function is void or value returning function. There are many acceptable program designs and you may design appropriate processing based on the function names provided. You may also use items from the StringTools library provided.
DetermineAccountType() DetermineTransactionType() CalculateServiceCharge() IsWarningFlaggedTransaction() ProcessCheck() ProcessDebitCard() ProcessDeposit() ProcessWithdrawl() ProcessOverdraft()
You must use a function with the following header
void UpdateTotals( int transactionTypeCode, // the code 1-6 for transaction type int amount //transaction amount int &balanceIncreaseCount // count of transactions which increase balance int &balanceDecreaseCount // count of transactions which iecrease balance int &balanceIncreaseAmount // total of transactions which increase balance int &balanceDecreaseCount // count of transactions which increase balance )
The TRANSACTIONS.txt file has the following format
Line 1 contains the 7 digit account number, a space, the account type code, a space and the beginning balance.
Line 2 and beyond contain a transaction number (up to 12 digits long), a space, a transaction type code, a space, a check number, a space, a transaction amount, a space, date in the form MM-DD-YYYY, a space and the payee
The number of lines in the file may vary from a minimum of 1 to an unknown maximum. You will not know how many items are in the file and should read all items until the end of file is reached.
Account Account minimum maximum Service Warning Type Code Type balance transactions Charge Amount 1 Basic Personal 500 10 $8.00 2500 2 Standard Personal 300 15 $10.00 2500 3 Basic Business 1500 20 $14.00 5000 4 Standard Business 5000 20 $0.00 5000
Each account is charged a monthly service charge according to the account type. Accounts which exceed the max transactions for the statement period will be charged an Excess Transaction fee of three times the service charge. Transaction types are as follows: 1 Check 2 Debit Card 3 Deposit 4 Withdrawl 5 Transfer Out 6 Transfer In
Any and every negative balance following a transaction will result in an Overdraft fee of $18.00 Certain transactions must be flagged for review to prevent money laundering. Any withdrawl or check with a payee of CASH in excess of the Warning Amount must be written to the WARNING file. WARNING FILE FORMAT:
date, transaction number, account number, amount with each value in a field 15 characters wide The WARNININGS.txt file should always be written from the main() function.
Statement Format displayed on the screen should resemble the following:
Statement for Account #xxxxxxx Standard Personal Account Date Reference Type Amount Payee Balance ---------- --------- -------------------- ----------- ----------------------- -------------- 10-25-2017 Prior Balance 101.32 101.32 10-26-2017 3343 Check 110.00 Triceratops Fashions -8.68 10-26-2017 Overdraft fee 18.00 -26.68 10-27-2017 Deposit 128.00 Cash 101.32 10-27-2017 Transfer In 900.00 PowerBoulder Lottery 1001.32 10-27-2017 3345 Check 200.00 Bedrock Furniture 801.32 10-27-2017 Debit 21.12 Bedrock Bowling 780.20 11-01-2017 Deposit 300.00 Slate Rock & Gravel 1080.20 11-02-2017 Transfer Out 100.00 Pebbles College Fund 980.20 11-05-2017 Withdrawl 30.00 Cash 950.20 11-15-2017 Service Charge 10.00 940.20 11-15-2017 Excess Transactions 0.00 940.20 Count Total Balance Increase 3 1328.00 Balance Decrease 7 489.12 ----------------------------------------------------------------------------------------- I try to make them like bottom. However, it is not worked. How do I fix it to work the program? If I totally wrong to make it, please make a above code and explain about them.
I am using the while(infile). I wrote inFile >> accountNumber >> accountTypeCode >> beginningBalance >> transactionNumber >> transactionTypecode >> checkNumber >> transactionAmount >> dateMonth >> bar >> dateDate >> bar >> dateYear >> payee; while (infile) inFile >> transactionNumber >> transactionTypecode >> checkNumber >> transactionAmount >> dateMonth >> bar >> dateDate >> bar >> dateYear >> payee; but if I wrote like that, it does not read the code. Also, I tried to make functions that in guideline before main function like double CalculateServiceCharge() { int accountTypeCode; double serviceCharage; if (accountTypeCode == 1) { serviceCharage = 8.00; } else if (accountTypeCode == 2) { serviceCharage = 10.00; } else if (accountTypeCode == 3) { serviceCharage = 14.00; } else if (accountTypeCode == 4) { serviceCharage = 0.00; } else { } return CalculateServiceCharge(); } it said that accountTypeCode is not defined. Thank you for reading.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
