1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
void writeFile(ofstream &savingFile, ofstream &checkingFile, vector<checkingAccount> &Caccount, vector<savingsAccount> &Saccount, int &co\
unt)
{
checkingFile << "Account Type,Account Number,first_name,last_name,company_name,address,city,phone1,phone2,Balance" << endl;
for (checkingAccount singleAccount : Caccount)
{
checkingFile << singleAccount.getAccountType() << "," << singleAccount.getAccountNumber() << "," << singleAccount.getFirstName() <<\
"," << singleAccount.getLastName() << "," << singleAccount.getCompanyName() << "," << singleAccount.getAddress() << "," << singleAccount\
.getCity() << "," << singleAccount.getPhone1() << "," << singleAccount.getPhone2() << "," << singleAccount.getBalance() << "," << endl;
checkingFile << endl;
}
savingFile << "Account Type,Account Number,first_name,last_name,company_name,address,city,phone1,phone2,Balance" << endl;
for (savingsAccount singleAccount : Saccount)
{
savingFile << singleAccount.getAccountType() << "," << singleAccount.getAccountNumber() << "," << singleAccount.getFirstName() << "\
," << singleAccount.getLastName() << "," << singleAccount.getCompanyName() << "," << singleAccount.getAddress() << "," << singleAccount.g\
etCity() << "," << singleAccount.getPhone1() << "," << singleAccount.getPhone2() << "," << singleAccount.getBalance() << "," << endl;
savingFile << endl;
}
}
|