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

this is my program I need data from the processesTransaction function to answer

ID: 3648605 • Letter: T

Question

this is my program I need data from the processesTransaction function to answer the questions for the createFile function can someone help me understand what I need to do.

#include <fstream> // file stream header file
#include <string> // string header file
#include <iostream> // for cout and cin header file
#include <iomanip> // formating header file

using namespace std;

void inputHeader(); // function prototype for the header (the columns)
void processesTransaction (); // function prototype that accesses the account file
void createFile(); // function prototype that accesses the accountSummary file

int main ()
{



inputHeader(); // my call to the header

cout<< fixed << showpoint << setprecision (2); // How many decimal places that my doubles are using

processesTransaction (); // this is my call to access my account file
createFile(); // this is my call to access my accountSummary file

system ("pause");
return 0; // Because main is an int it needs to return something so it is returning zero
}

void inputHeader() //input header
{
cout << "TRANS ID" << setw (13) << "DATE" << setw (14)
<< "AMOUNT" << setw (14) << "TYPE"<< setw (14) <<"TOTAL" << endl;// this is the column headers
cout << "*********************************************************************"<<endl; // seperation from data
}

void processesTransaction () // My function that accesses the account file
{
// declareing the variables
ifstream infile; // the variable name for my account file
int transactionID;
double total=0; // set the total to zero for a new account
double amount;
string date;
string type;



//open the file
infile.open("account.txt");


//check for file
if (infile.fail())
{
cerr<<"file does not exist:";
abort();
}

//checking for file input
while(! infile.eof())

if (infile >> transactionID)
{
infile >> date>>amount>>type;


// if statement for withdrawal/deposit.
if (type == "withdrawal")
{
total=total-amount;
}
else
total = total+amount;

// reading from file
cout <<transactionID << setw (14)<< date << setw (14) << amount << setw (14) << type<< setw (14)<<total;

if (total<0)
{
cout<< " overdrawn ";
}

cout<<endl;

}
infile.close(); // closing the account file



}


void createFile()/*******function that creates the accountSummary file**********/
{
//declaring variables
ofstream outfile; // variable name for my accountSummary file


outfile.open("accountSummary.txt");// open the file



/*Number of transactions
Date of last transaction
the final total after all transactions are processed*/

// display
outfile<<

Explanation / Answer

please post clear code , use komodo to do that