[code]#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int num=0;
int tot=0;
ofstream myfile;
myfile.open("payroll.txt");
for(int i=1;i<=7;i++)
{
cout<<"Please enter total payroll value for day "<<i<<endl;
cin>>num;
if (num>0)
{
tot=tot+num;
}
}
myfile<<tot<<endl;
myfile.open("payroll.txt",ios::app);
return 0;
}
/code]
Thanks! Such a simple error!