Modify the given program so that if allows the user to repeat the process for several transactions using the while loop. The program should call function DispTrans that tabulates the transaction information as tabulated below. The program provides for a maximum of 20 transactions, but allows the user to enter the actual number of transactions.
Outputs Tabulation Format:
TransType Beg.Balance DepositAmt WithdrawAmt End.Balance
_________ _________ _________ _________ _________
_________ _________ _________ _________ _________
Totals _________ _________ _________ _________
You will see an incomplete funtion definition at the end of the program.. can you give some suggestions about this given problem
#include<iostream>
using std:: cout;
using std:: cin;
using std:: endl;
#include<iomanip>
using std:: setprecision;
using std:: setiosflags;
using std:: setw;
double PerformCompute( double Sbal, char transType, double TAmt);
int main()
{ double startingBalance, endingBalance, transAmount;
char tran;
cout<<"Enter the starting balance and press <Enter>:";
cin>>startingBalance;
cout<<"Enter transaction type (D) deposit or (W) withdrawal"<<endl<<endl<< and press <Enter>";
cin>>transAmount;
endingBalance=PerformCompute(startingBalance, tran, transAmount);
cout<<setiosflags(ios::fixed|ios::showpoint|ios::right);
cout<<setprecision(2)<<endl;
cout<<"Starting Balance "<<startingBalance<<endl<<"Transaction ""<<transAmount<< " "<<tran <<endl;
cout<<"Ending Balance "<<endingBalance<<endl;
return 0;
}
double PerformCompute(double Sbal, char transType, double TAmt)
{double a,b;
if(transType=='D' || transType=='d')
{a=Sbal+TAmt;
return a;}
if (transType=='W' || transType=='w')
{b=Sbal -TAmt;
return b;}
}
double DispTrans(
{int i=1,m;
while(i<=20)
{if(transType=='D' || transType=='d')
{cout<<"Enter the transaction: ";
cin>>m;}
if(transType=='W' || transType=='w')
{cout<<"Enter the transaction: ";
cin>>m;}
i++}