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

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

ID: 3795666 • Letter: I

Question

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

Explanation / Answer

while (!inf.eof() )

{

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

        std::string strInput;

        inf >> strInput;

        cout << strInput << endl;

}