You can fix the exiting with a while loop:
Code:
bool usercontinue (void)
{
char DoneCharacter;
cout <<
endl <<
"Continue?" <<
" - Press \"n\" and \"Enter\" to stop: ";
cin >> DoneCharacter;
return (DoneCharacter != 'n'); // true when not "n"
}
int main()
{
while(usercontinue()) {
string name, date, action, descript;
float balance, amount;
ifstream fin;
ofstream fout;
cout << "enter the name of the Checkbook filename: " << endl;
cin >> name;
//string update(name);
//update.append(".update");
fin.open(name.c_str(), ios::in);
fin >> balance;
while (!fin.eof())
{
fin >> date >> action;
//cout << date << action;
fout << date << action;
if (action == "credit")
{
fin >> amount;
fout << amount;
balance = balance + amount;
}
else if (action == "debit")
{
fin >> amount;
fout << amount;
balance = balance - amount;
}
getline(fin, descript);
fout << descript;
}
fout << balance;
fin.close();
//fout.close();
}
}//end main