I need help with this c code asap please include include inc

I need help with this c++ code asap please!!!

#include

#include

#include

#include \"employee.h\"

using namespace std;

int main()

{

      int basepay = 800;

      employee emp;

      ifstream inf;

      inf.open(\"employee.txt\");

      ofstream outf;

      outf.open(\"employeeout.txt\");

      if(!inf)

      {

            cout << \" *** Input file does not exist! *** \" << endl;

            return 1;

    }

      outf << \"R. Sklar CUS 1151 Project #1 \" << endl

            << \"This is the Badwater Brewery\'s Employee record List\" << endl <

     

      outf << \"ID #\" << setw(20) << \"Salary\" << endl;

      outf << \"****************************\" << endl;

      while (!inf.eof() )

      {

         I have to write the body of this loop. All i need is 3 lines.

      }

   

      inf.close();

      outf.close();

      return 0;

}

employee.h class

#ifndef H_employee
#define H_employee

#include <fstream>

using namespace std;


// The specification file for the class employee

class employee

{
public:

   void getdata(ifstream& inf);

   void computation(int basepay);

   void print(ofstream& outf) const;

   employee();

private:

   int ID;
   int Job_class;
   int Years;
   int Ed;
   float sal;

};

#endif

Solution

while (!inf.eof() )

{

// read stuff from the file into a string and print it

        std::string strInput;

        inf >> strInput;

        cout << strInput << endl;

}

I need help with this c++ code asap please!!! #include #include #include #include \
I need help with this c++ code asap please!!! #include #include #include #include \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site