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

Response Detail what is the file name for this program i keep gettinga message t

ID: 3609680 • Letter: R

Question

Response Detail what is the file name for this program i keep gettinga message to check file name cause its not correct ? how do i makeit work ? #include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
using namespace std;
void getfile(char[]);
double calcbonus(int);
double additional(int);
double calcheck(int,double,double);
void accumulate(int&,int&,double&,double,int);
int main(){
string first,last,store ;
char filename[30];
int count=0,high=0,years,base,sales;
double bonus,addbonus,salary,check,total=0;
ifstream in;
ofstream out;
getfile(filename);
in.open(filename);          //open file
  if(in.fail())            //is it ok?
       { cout<<"input file didnot open please check it ";
        system("pause");
        return 1;
        }
  out.open("yourlastname.txt");          //open file
  if(out.fail())            //is it ok?
       { cout<<"output file didnot open please check it ";
        system("pause");
        return 1;
        }
   out<<"name ..... ";
   cout<<"output filenamed      yourlastname.txt ";
   getline(in,store);
  cout<<"first        last      years  base                 additional ";
  cout<<"name         name     worked pay  sales    bonus   bonus      check ";
   out<<store<<endl;
  out<<"first        last      years  base                 additional ";
  out<<"name         name     worked pay  sales    bonus   bonus      check ";
  in>>first;               
   while(in)       
    {in>>last>>years>>base>>sales;
    
    
      bonus=calcbonus(years);
      addbonus=additional(sales);
     check=calcheck(base,bonus,addbonus);
      if(sales>=10000)
        {out<<setw(12)<<first<<setw(10)<<last<<setw(7)<<years<<setw(7)<<base<<setw(7)<<sales;
         out<<setw(7)<<bonus<<setw(12)<<addbonus<<setw(10)<<check<<endl;
          }
     accumulate(count,high,total,check,sales);
    cout<<setw(12)<<first<<setw(10)<<last<<setw(7)<<years<<setw(7)<<base<<setw(7)<<sales;
    cout<<setw(7)<<bonus<<setw(12)<<addbonus<<setw(10)<<check<<endl;
   
     in>>first;
     }
    cout<<" numberEmployees:    "<<count<<endl;
    cout<<"number high sellers:   "<<high<<endl;
    cout<<"total monthly payroll:"<<total<<endl;
   in.close();
   out.close();
system("pause");
return 0;   
}
void accumulate(int &c,int &h,double &t,doublecheck,int sales)
{c++;
if(sales>=10000)
   h++;
t+=check;
return;
}

double calcheck(int s,double b,double a)
{return s+b+a;
}
double calcbonus(int y)
{double bonus;
if( y<=5)
   bonus=10*y;
else
   bonus=20*y;
return bonus;
}
double additional(int s)
{double add;
if(s<5000)
    add=0;
else
    if(s>=5000&&s<10000)
        add=s*.03;
    else
        add=s*.06;
return add;
}
    
void getfile(char name[])
{ cout<<"Enter filename of input: ";
cin>>name;
return;
}
Response Detail what is the file name for this program i keep gettinga message to check file name cause its not correct ? how do i makeit work ? what is the file name for this program i keep gettinga message to check file name cause its not correct ? how do i makeit work ? #include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
using namespace std;
void getfile(char[]);
double calcbonus(int);
double additional(int);
double calcheck(int,double,double);
void accumulate(int&,int&,double&,double,int);
int main(){
string first,last,store ;
char filename[30];
int count=0,high=0,years,base,sales;
double bonus,addbonus,salary,check,total=0;
ifstream in;
ofstream out;
getfile(filename);
in.open(filename);          //open file
  if(in.fail())            //is it ok?
       { cout<<"input file didnot open please check it ";
        system("pause");
        return 1;
        }
  out.open("yourlastname.txt");          //open file
  if(out.fail())            //is it ok?
       { cout<<"output file didnot open please check it ";
        system("pause");
        return 1;
        }
   out<<"name ..... ";
   cout<<"output filenamed      yourlastname.txt ";
   getline(in,store);
  cout<<"first        last      years  base                 additional ";
  cout<<"name         name     worked pay  sales    bonus   bonus      check ";
   out<<store<<endl;
  out<<"first        last      years  base                 additional ";
  out<<"name         name     worked pay  sales    bonus   bonus      check ";
  in>>first;               
   while(in)       
    {in>>last>>years>>base>>sales;
    
    
      bonus=calcbonus(years);
      addbonus=additional(sales);
     check=calcheck(base,bonus,addbonus);
      if(sales>=10000)
        {out<<setw(12)<<first<<setw(10)<<last<<setw(7)<<years<<setw(7)<<base<<setw(7)<<sales;
         out<<setw(7)<<bonus<<setw(12)<<addbonus<<setw(10)<<check<<endl;
          }
     accumulate(count,high,total,check,sales);
    cout<<setw(12)<<first<<setw(10)<<last<<setw(7)<<years<<setw(7)<<base<<setw(7)<<sales;
    cout<<setw(7)<<bonus<<setw(12)<<addbonus<<setw(10)<<check<<endl;
   
     in>>first;
     }
    cout<<" numberEmployees:    "<<count<<endl;
    cout<<"number high sellers:   "<<high<<endl;
    cout<<"total monthly payroll:"<<total<<endl;
   in.close();
   out.close();
system("pause");
return 0;   
}
void accumulate(int &c,int &h,double &t,doublecheck,int sales)
{c++;
if(sales>=10000)
   h++;
t+=check;
return;
}

double calcheck(int s,double b,double a)
{return s+b+a;
}
double calcbonus(int y)
{double bonus;
if( y<=5)
   bonus=10*y;
else
   bonus=20*y;
return bonus;
}
double additional(int s)
{double add;
if(s<5000)
    add=0;
else
    if(s>=5000&&s<10000)
        add=s*.03;
    else
        add=s*.06;
return add;
}
    
void getfile(char name[])
{ cout<<"Enter filename of input: ";
cin>>name;
return;
}
Response Detail what is the file name for this program i keep gettinga message to check file name cause its not correct ? how do i makeit work ? #include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
using namespace std;
void getfile(char[]);
double calcbonus(int);
double additional(int);
double calcheck(int,double,double);
void accumulate(int&,int&,double&,double,int);
int main(){
string first,last,store ;
char filename[30];
int count=0,high=0,years,base,sales;
double bonus,addbonus,salary,check,total=0;
ifstream in;
ofstream out;
getfile(filename);
in.open(filename);          //open file
  if(in.fail())            //is it ok?
       { cout<<"input file didnot open please check it ";
        system("pause");
        return 1;
        }
  out.open("yourlastname.txt");          //open file
  if(out.fail())            //is it ok?
       { cout<<"output file didnot open please check it ";
        system("pause");
        return 1;
        }
   out<<"name ..... ";
   cout<<"output filenamed      yourlastname.txt ";
   getline(in,store);
  cout<<"first        last      years  base                 additional ";
  cout<<"name         name     worked pay  sales    bonus   bonus      check ";
   out<<store<<endl;
  out<<"first        last      years  base                 additional ";
  out<<"name         name     worked pay  sales    bonus   bonus      check ";
  in>>first;               
   while(in)       
    {in>>last>>years>>base>>sales;
    
    
      bonus=calcbonus(years);
      addbonus=additional(sales);
     check=calcheck(base,bonus,addbonus);
      if(sales>=10000)
        {out<<setw(12)<<first<<setw(10)<<last<<setw(7)<<years<<setw(7)<<base<<setw(7)<<sales;
         out<<setw(7)<<bonus<<setw(12)<<addbonus<<setw(10)<<check<<endl;
          }
     accumulate(count,high,total,check,sales);
    cout<<setw(12)<<first<<setw(10)<<last<<setw(7)<<years<<setw(7)<<base<<setw(7)<<sales;
    cout<<setw(7)<<bonus<<setw(12)<<addbonus<<setw(10)<<check<<endl;
   
     in>>first;
     }
    cout<<" numberEmployees:    "<<count<<endl;
    cout<<"number high sellers:   "<<high<<endl;
    cout<<"total monthly payroll:"<<total<<endl;
   in.close();
   out.close();
system("pause");
return 0;   
}
void accumulate(int &c,int &h,double &t,doublecheck,int sales)
{c++;
if(sales>=10000)
   h++;
t+=check;
return;
}

double calcheck(int s,double b,double a)
{return s+b+a;
}
double calcbonus(int y)
{double bonus;
if( y<=5)
   bonus=10*y;
else
   bonus=20*y;
return bonus;
}
double additional(int s)
{double add;
if(s<5000)
    add=0;
else
    if(s>=5000&&s<10000)
        add=s*.03;
    else
        add=s*.06;
return add;
}
    
void getfile(char name[])
{ cout<<"Enter filename of input: ";
cin>>name;
return;
}

Explanation / Answer

please rate - all answers -thanks input.txt but remeber you have to create the file with the correct datain it
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote