Please Help With This C++ Question

+1 Smart Kid · December 7, 2015
Please I need help with this question: 

Write a C++ program that simulates banking transactions for a checking account. The main program should read from the data file account.txt the initial balance in the checking account. The main program should read from the data file transactions.txt a list of the user’s deposits and withdrawals for the month. Each line in the data file contains a D for a deposit or a W for withdrawal and the transaction amount to be deposited or withdrawn. The number of lines in the data file is unknown. 

The program should contain the following two functions. 

void MakeWithdrawal(float, float&) 
void MakeDeposit(float, float&) 

As mentioned above, the main program reads the data from the data file. Whenever a D is read from the data file, the MakeDeposit function should be called. The amount of the deposit and the balance should be passed as arguments to the function. The amount is passed as a value parameter and the balance should be passed as a reference parameter between the function and the main program. The MakeDeposit function should add the deposit amount to the balance. After the transaction, the main program should print to the data file statement.txt a message showing the amount of the deposit, and the balance after the deposit. 

Whenever a W is read from the data file, the MakeWithdrawal function should be called. The amount of the withdrawal and the balance should be passed as arguments to the function. The balance should be passed as a reference parameter between the function and the main program and the withdrawal amount as a value parameter. The MakeWithdrawal function subtracts the withdrawal amount from the balance. If the balance is below $0.00, the function should also subtract an additional $30 fee. After the transaction, the main program should print to the data file statement.txt a message showing the amount of the withdrawal and balance after the withdrawal. The program should continue until there is no more data in the file. After all data has been read, the main program should print to the data file statement.txt the number of transactions the user had for the month and the ending balance in the checking account. 

Many thanks.

Post a Reply

Replies

Oldest  Newest  Rating
+2 Oren Drobitsky · December 8, 2015
DON'T expect us to do your homework.
THINK.
0 Myron Ortiz · December 8, 2015
http://3.bp.blogspot.com/-qn4nmRaXxJk/T1PMxgWUstI/AAAAAAAACHw/dCxxl1IkPKo/s1600/sniffing+markers+scented+marker+sharpies+get+you+high.jpg

Smells like homework.
  • 1

C++

106,931 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator