TestProj5
GitHub Classroom URL: see Blackboard

**Note - Any updates to the description will be found on the ZyBook description of this project.

Pete’s Pets has four types of employees.
Managers, who receive a fixed weekly salary
Clerks, who receives a fixed hourly wage for up to the first 40 hours they work and "time-and-a-half," i.e., 1.5 times their hourly wage, for overtime hours worked
Vets, who receive $800 plus $3.75 for each vaccine they administer
Stylists, who receive a fixed amount of money per appointment.

Create a program that calculates the weekly pay for employees of "Pete's Pets", the total payroll and print's out a Weekly Pay Report.

You do not know the number of employees in the file in advance.

Each type of employee has its own pay code:

Managers have paycode 1
Clerks have code 2
Vets have code 3
Stylists have code 4
Input will come from a sequential file that has a line for each employee.

The first item in the line will always be the paycode.
The second and third item will be the first and last name.
The fourth item will be the employee ID.
For a paycode of 1, the salary will be the next item. If the pay code is 2, hourly salary is the next item followed by hours worked. If the pay code is 3, the next item will be the number of vaccines administered. If the pay code is 4, the next item will be the payrate per appointment followed by the number of appointments. All items in a line of the file are separated by a space.
You have been provided with the following classes:

Employee.h (simple class, no need for .cpp file). Implement the < and > operators. Use the employee number to determine > or <.
main.cpp (driver class)
test.cpp (this is used for the autograding)
testing.cpp (this is the one to run on the gl server and get a valgrind report on)
Requirements:

Implement 4 derived classes that inherit from Employee (these are your Data Element classes). An empty .h and .cpp file have been created for each of these.
(a) Manager -
(b) Clerk
(c) Stylist
(d) Vet
They will contain variables appropriate for the type of employee. They inherit from Employee and define the virtual method(s). There should also be getters for private members unique to each class, and any other methods that are needed for your design. The parameterized constructor should call the constructor of the Employee class with member initialization syntax. Provide a copy constructor. The toString method will override the Employee toString method and use the Employee::toString method within the implementation. Provide a destructor. Use const to represent any constants.

Create a Data Manager class called Employees. You have been provided with the .h file and an empty .cpp file. It will contain a vector that holds pointers to Employee objects that will accommodate pointers to Manager, Clerk, Stylist and Vet objects. Add any other variables needed for your design including numManagers, numClerks, numStylist and numVets, which will be incremented when you add an Employee of this type. Employees will contain the following functions:
(a) void addEmployee(string). The string passed in will be one line from the input file. Use the paycode to determine what is to be extracted from the string. Create the correct type of object and add it to the vector.
(b) double calculateWeeklyPay(). Returns the sum of weekly pay for all objects in the vector.
(c) string printReport(). Returns a string with the Weekly Pay Report. The employees are sorted by employee number in the report. (The necessary methods and overloaded operators needed for the sort are provided for you.)The Employee Number and First and Last Names are printed in a column of width 25. The Weekly Pay is printed in a column of width 10. Total Payroll will be printed as well as the number of each type of employee. Look at the example output to see the details of the Weekly Pay Report. All pay must be printed with 2 decimal places.
(d) Rule of 3 - Copy constructor, Destructor, operator= . You will need the clone() for the copy constructor and =.
(e) Default constructor
Any additional functions you may need for your design must be private utility functions. **** Make sure any .h files you need for the derived classes are put in the Employees.h, not the Employees.cpp

main.cpp will read from the file and print out the report.

Given the following input file:

4 Paul Johnson 44444 8.75 75
1 Eric Hall 11111 1200.00
3 Katie Bell 33333 55
2 Patrick Brown 22222 12.50 50
The following report will be printed:

Weekly Pay Report for Pete's Pets

Employee                 Weekly Pay
11111 Eric Hall             1200.00
22222 Patrick Brown          687.50
33333 Katie Bell            1006.25
44444 Paul Johnson           656.25

Total payroll: 3550.00
Managers: 1
Clerks: 1
Vets: 1
Stylist: 1
Given the following file:

4 Paul Johnson 44444 8.75 75
2 Erica Smith 12345 8.75 35
1 Eric Hall 11111 1200.00
4 Paula Potter 34567 12.25 43
3 Katie Bell 33333 55
2 Patrick Brown 22222 12.50 50
3 Kelly Myers 23456 22
3 Karen Miller 45678 34
The following report will be printed:

Weekly Pay Report for Pete's Pets

Employee                 Weekly Pay
11111 Eric Hall             1200.00
12345 Erica Smith            306.25
22222 Patrick Brown          687.50
23456 Kelly Myers            882.50
33333 Katie Bell            1006.25
34567 Paula Potter           526.75
44444 Paul Johnson           656.25
45678 Karen Miller           927.50

Total payroll: 6193.00
Managers: 1
Clerks: 2
Vets: 3
Stylist: 2
You have been provided with two data files - employees.txt and employeesA.txt You have been provided with two testing files - tests.cpp is for the autograding and testing.cpp is the one to test your program on the gl server and run a valgrind report. A makefile is provided. "make driver" will run main.cpp. "make testing" will run all the tests and give you a score. "make testMemory" is for the gl server to find memory leaks. "make test" will run the tests that are used for the autograding. 

this is a project i am working on i current have this 

#pragma once
#include "Employee.h"
#include <string>
#include <sstream>
#include <iomanip>

using namespace std;

class Stylist : public Employee {
    private:
    double weeklySalary;
    int aptNumber;

    public:
    Stylist(string fname, string lname, int idNumber, double salary, int aptNumber);
    virtual ~Stylist();
    virtual Employee* clone();
    virtual double calcWeeklyPay();
    virtual string toString() ;
};
#pragma once
#include "Employee.h"
#include <string>
#include <sstream>
#include <iomanip>

class Vet : public Employee {
    private:
    double salary;

    public:
    Vet(string fName, string lname, int idNumber, double salary);
    virtual ~Vet();
    virtual Employee* clone();
    virtual double calcWeeklyPay();
    virtual string toString();
};
 
#pragma once
#include "Employee.h"
#include <string>
#include <sstream>
#include <iomanip>

class Manager : public Employee {
    
    private:
    double weeklySalary;

    public:
    Manager(string fname,string lname, int eNum, double salary);
    virtual ~Manager();
    virtual Employee* clone();
    virtual double calcWeeklyPay();
    virtual string toString(); 
    
};
 
#pragma once
#include <vector>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include "Employee.h"
#include "Manager.h"
#include "Clerk.h"
#include "Vet.h"
#include "Stylist.h"

using namespace std;
class Employees
{
private:
	vector<Employee*>* workers;
	int numManagers, numClerks, numVets, numStylists;

public:
	Employees();
	~Employees();
	Employees(const Employees& other);
	void addEmployee(string line);
	double calculateWeeklyPay();
	string printReport();
	int getNumManagers() { return numManagers; }
	int getNumClerks() { return numClerks; }
	int getNumStylists() { return numStylists; }
	int getNumVets() { return numVets; }
	Employee* getFirst() { return workers->at(0); }
	Employees& operator=(const Employees& other);
	bool static compareEmployees(const Employee* left, const Employee* right) {
		return(*left < *right);
	}

};


 
#pragma once
#include <string>
#include <sstream>
#include <iomanip>
using namespace std;

class Employee
{
private:
	string firstName, lastName;
	int empNumber;

public:
	Employee(string fname, string lname, int eNum) {
		firstName = fname;
		lastName = lname;
		empNumber = eNum;
	};
	virtual ~Employee() {};
	virtual Employee* clone()=0;
	virtual double calcWeeklyPay() = 0;
	virtual string toString() {
		ostringstream oSS;
		oSS << empNumber << " " << firstName << " " << lastName;
		return oSS.str();
	}

	int getEmpNum() { return empNumber; }
	string getFname() { return firstName; }
	string getLname() { return lastName; }

	//Allow the comparison and sorting of employee objects
	friend bool operator>(const Employee& lhs, const Employee& rhs) {
		return lhs.empNumber > rhs.empNumber;
	}

	friend bool operator<(const Employee& lhs, const Employee& rhs) {
		return lhs.empNumber < rhs.empNumber;
	}

};
 #pragma once
#include <string>
#include <sstream>
#include <iomanip>
#include "Employee.h" 
using namespace std;

class Clerk : public Employee
{
private:
    double hourlyWage;
    double hoursWorked;

public:
    Clerk(string fname, string lname, int eNum, double hourlyWage, double hoursWorked);
    virtual ~Clerk();
    virtual Employee* clone();
    virtual double calcWeeklyPay();
    virtual string toString();  


};

 
implemented does this seem correct t oyou? it currently passes all of myu test which are 
#include "Employees.h"
#include "Employee.h"
#include "Manager.h"
#include "Clerk.h"
#include "Vet.h"
#include "Stylist.h"
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;

void printResultsStr(int result, string expected="", string student=""){
    if(result==0)
        cout << "Passed this test\n\n";
    else {
        cout << "FAILED this test\n";
        cout << "\nExpected result: \n"<<expected<<"\nYour result: \n"<<student<<endl;
    }
}
void printResultsInt(int result, int expected, int student){
    if(result==0)
        cout << "Passed this test\n";
    else {
        cout << "FAILED this test\n";
        cout << "\nExpected result: \n"<<expected<<"\nYour result: \n"<<student<<endl;
    }
}

vector<string> split(string resultString, char delimiter) {
    stringstream resultStream(resultString);
    vector<string> result;
    string str, str2;

    while (getline(resultStream, str, delimiter)) {
        result.push_back(str);
    }
    return result;
}

int testPassedClerkNoOvertime() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;
    Employee* employee;
    Clerk* clerk;
    int numClerks, empNum;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay;

    numClerks = employees.getNumClerks();
    cout << "Number of clerks before add: " << numClerks << endl;
    employees.addEmployee("2 Patrick Brown 22222 12.50 40");
    cout << "addEmployee(\"2 Patrick Brown 22222 12.50 40\")" << endl;
    numClerks = employees.getNumClerks();
    cout << "Number of clerks after add: " << numClerks << endl;

    if (numClerks == 1) {
        employee = employees.getFirst();
        clerk = static_cast<Clerk*>(employee);
        pay = clerk->calcWeeklyPay();
        empNum = clerk->getEmpNum();
        lname = clerk->getLname();
        fname = clerk->getFname();

        if (pay-500.00<.01) {
            if (fname.compare("Patrick") == 0) {
                if (lname.compare("Brown") == 0) {
                    if (empNum == 22222) {
                        cout << "22222 Patrick Brown 500.00. Correctly added a clerk object" << endl;
                        returnResult = 0;
                    }
                    else {
                        expectedString = "employee number: 22222.\n";
                        student = "employee number: " + empNum;
                    }
                }
                else {
                    expectedString = "last name: Brown.\n";
                    student = "last name: " + lname;
                }
            }
            else {
                expectedString =  "first name: Patrick.\n";
                student = "first name: " + fname;
            }
        }
        else {
            expectedString = "Pay: 500.00.\n";
            student = "Pay: " + to_string(pay);
        }
    }

    else {
        student = "Clerk object not added correctly or number of clerks was not updated correctly\n";

        return false;
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedClerkOvertime() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;
    Employee* employee;
    Clerk* clerk;
    int numClerks, empNum;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay;

    numClerks = employees.getNumClerks();
    cout << "Number of clerks before add: " << numClerks << endl;
    employees.addEmployee("2 Patrick Brown 22222 12.50 50");
    cout << "addEmployee(\"2 Patrick Brown 22222 12.50 50\")" << endl;
    numClerks = employees.getNumClerks();
    cout << "Number of clerks after add: " << numClerks << endl;

    if (numClerks == 1) {
        employee = employees.getFirst();
        clerk = static_cast<Clerk*>(employee);
        pay = clerk->calcWeeklyPay();
        empNum = clerk->getEmpNum();
        lname = clerk->getLname();
        fname = clerk->getFname();
        if (pay-687.50 < .01) {
            if (fname.compare("Patrick") == 0) {
                if (lname.compare("Brown") == 0) {
                    if (empNum == 22222) {
                        cout << "22222 Patrick Brown 687.50. Correctly added a clerk object" << endl;
                        returnResult = 0;
                    }
                    else {
                        expectedString = "employee number: 22222.\n";
                        student = "employee number: " + empNum;
                    }
                }
                else {
                    expectedString = "last name: Brown.\n";
                    student = "last name: " + lname;
                }
            }
            else {
                expectedString = "first name: Patrick.\n";
                student = "first name: " + fname;
            }
        }
        else {
            expectedString = "Pay: 687.50.\n";
            student = "Pay: " + to_string(pay);
            student += "\nPay is not calculated correctly (don't forget about overtime)\n";
        }
    }

    else {
        student =  "Clerk object not added correctly or number of clerks was not updated correctly";
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedManager() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;
    Employee* emp;
    Manager* employee;
    int numManagers, empNum;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay;

    numManagers = employees.getNumManagers();
    cout << "Number of managers before add: " << numManagers << endl;
    employees.addEmployee("1 Eric Hall 11111 1200.00");
    cout << "addEmployee(\"1 Eric Hall 11111 1200.00\")" << endl;
    numManagers = employees.getNumManagers();
    cout << "Number of manager after add: " << numManagers << endl;

    if (numManagers == 1) {
        emp = employees.getFirst();
        employee = static_cast<Manager*>(emp);
        pay = employee->calcWeeklyPay();
        empNum = employee->getEmpNum();
        lname = employee->getLname();
        fname = employee->getFname();
        if (pay-1200.00<.01) {
            if (fname.compare("Eric") == 0) {
                if (lname.compare("Hall") == 0) {
                    if (empNum == 11111) {
                        cout << "11111 Eric Hall 1200.00. Correctly added a clerk object" << endl;
                        returnResult = 0;
                    }
                    else {
                        expectedString = "employee number: 11111.\n";
                        student = "employee number: "+empNum;
                    }
                }
                else {
                    expectedString =  "last name: Hall.\n";
                    student = "last name: " +lname;
                }
            }
            else {
                expectedString = "first name: Eric.\n";
                student = "first name: " + fname;
            }
        }
        else {
            expectedString = "Pay: 1200.00.\n";
            student = "Pay: " + to_string(pay);
        }
    }

    else {
        student = "Manager object not added correctly or number of managers was not updated correctly\n";
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedVet() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;
    Employee* emp;
    Vet* employee;
    int numVets, empNum;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay;

    numVets = employees.getNumVets();
    cout << "Number of vets before add: " << numVets << endl;
    employees.addEmployee("3 Katie Bell 33333 55");
    cout << "addEmployee(\"3 Katie Bell 33333 55\")" << endl;
    numVets = employees.getNumVets();
    cout << "Number of vets after add: " << numVets << endl;

    if (numVets == 1) {
        emp = employees.getFirst();
        employee = static_cast<Vet*>(emp);
        pay = employee->calcWeeklyPay();
        empNum = employee->getEmpNum();
        lname = employee->getLname();
        fname = employee->getFname();
        if (pay-1006.25<.01) {
            if (fname.compare("Katie") == 0) {
                if (lname.compare("Bell") == 0) {
                    if (empNum == 33333) {
                        cout << "33333 Katie Bell 1006.25 Correctly added a vet object" << endl;
                        returnResult = 0;
                    }
                    else {
                        expectedString = "employee number: 33333.\n";
                        student = "employee number: " +empNum;
                    }
                }
                else {
                    expectedString = "last name: Bell.\n";
                    student = "last name: " + lname;
                }
            }
            else {
                expectedString = "first name: Katie.\n";
                student = "first name: " +fname;
            }
        }
        else {
            expectedString = "Pay: 1006.25.\n";
            student = "Pay: " + to_string(pay);
            student += "\nVet object not added correctly or pay is not calculated correctly";
        }
    }

    else {
        student = "Vet object not added correctly or number of vets was not updated correctly\n";
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedStylist() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;
    Employee* emp;
    Stylist* employee;
    int numStylists, empNum;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay;

    numStylists = employees.getNumStylists();
    cout << "Number of Stylists before add: " << numStylists << endl;
    employees.addEmployee("4 Paul Johnson 44444 8.75 75");
    cout << "addEmployee(\"4 Paul Johnson 44444 8.75 75\")" << endl;
    numStylists = employees.getNumStylists();
    cout << "Number of Stylists after add: " << numStylists << endl;

    if (numStylists == 1) {
        emp = employees.getFirst();
        employee = static_cast<Stylist*>(emp);
        pay = employee->calcWeeklyPay();
        empNum = employee->getEmpNum();
        lname = employee->getLname();
        fname = employee->getFname();
        if (pay-656.25<.01) {
            if (fname.compare("Paul") == 0) {
                if (lname.compare("Johnson") == 0) {
                    if (empNum == 44444) {
                        cout << "44444 Paul Johnson 656.25 Correctly added a Stylist object" << endl;
                        returnResult =0;
                    }
                    else {
                        expectedString =  "employee number: 44444.\n";
                        student = "employee number: " + empNum;
                    }
                }
                else {
                    expectedString = "last name: Johnson.\n";
                    student = "last name: " + lname;
                }
            }
            else {
                expectedString = "first name: Paul.\n";
                student = "first name: " +fname;
            }
        }
        else {
            expectedString = "Pay: 656.25.\n";
            student = "Pay: " + to_string(pay);
            student += "Stylist object not added correctly or pay is not calculated correctly\n";
        }
    }

    else {
        student = "Stylist object not added correctly or number of vets was not updated correctly\n";
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedCalcWeeklyPay() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay;

    cout << "adding the following employees;" << endl;
    cout << "addEmployee(\"4 Paul Johnson 44444 8.75 75\")" << endl;
    cout << "addEmployee(\"1 Eric Hall 11111 1200.00\")" << endl;
    cout << "addEmployee(\"3 Katie Bell 33333 55\")" << endl;
    cout << "addEmployee(\"2 Patrick Brown 22222 12.50 50\")" << endl;

    employees.addEmployee("4 Paul Johnson 44444 8.75 75");
    employees.addEmployee("1 Eric Hall 11111 1200.00");
    employees.addEmployee("3 Katie Bell 33333 55");
    employees.addEmployee("2 Patrick Brown 22222 12.50 50");

    pay = employees.calculateWeeklyPay();

    if (pay-3550.00<.01) {
        cout << "Total Weekly Pay of 3500.00 was calculated correctly" << endl;
        returnResult = 0;
    }

    else {
        expectedString = "Total Weekly Pay: 3550.00.\n";
        student = "Total Weekly Pay: " + to_string(pay);
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedCopyconstructor() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees, employees2;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay, pay2;

    cout << "adding the following employees to Employees object employees;" << endl;
    cout << "addEmployee(\"4 Paul Johnson 44444 8.75 75\")" << endl;
    cout << "addEmployee(\"1 Eric Hall 11111 1200.00\")" << endl;
    cout << "addEmployee(\"3 Katie Bell 33333 55\")" << endl;
    cout << "addEmployee(\"2 Patrick Brown 22222 12.50 50\")" << endl;

    employees.addEmployee("4 Paul Johnson 44444 8.75 75");
    employees.addEmployee("1 Eric Hall 11111 1200.00");
    employees.addEmployee("3 Katie Bell 33333 55");
    employees.addEmployee("2 Patrick Brown 22222 12.50 50");

    pay = employees.calculateWeeklyPay();

    if (pay-3550.00<.01) {
        cout << "Total Weekly Pay of 3500.00 for employees was calculated correctly" << endl << endl;
        cout << "Creating new Employees object: Employees employees2(employees)" << endl;
        Employees employees2(employees);
        cout << "employees2.addEmployee(\"2 Georgia Jones 10111 12.50 40\")" << endl;
        employees2.addEmployee("2 Georgia Jones 10111 12.50 40");
        cout << "employees2.calculateWeeklyPay()" << endl;
        pay2 = employees2.calculateWeeklyPay();
        pay = employees.calculateWeeklyPay();
        cout << "workers" << endl;
        
        if (((pay2 - 4050.00) < .01) && ((pay - 3550.00) < .01)) {
            cout << "Copy Constructor working correctly, total Weekly Pay for employees2 = 4050.00\n"
                << "and total Weekly Pay for employees is still 3500.00" << endl;
            returnResult = 0;
        }
        else {
            expectedString = "Total Weekly Pay: 4050.00.\n";
            student = "Total Weekly Pay: " + to_string(pay);
        }
    }

    else {
        expectedString = "Total Weekly Pay: 3550.00.\n";
        student = "Total Weekly Pay: " + to_string(pay);
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedEquals() {
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees, employees3;
    string line, result, fname, lname;
    //istringstream iSS, lineSS;
    double pay, pay3;

    cout << "adding the following employees to Employees object employees;" << endl;
    cout << "addEmployee(\"4 Paul Johnson 44444 8.75 75\")" << endl;
    cout << "addEmployee(\"1 Eric Hall 11111 1200.00\")" << endl;
    cout << "addEmployee(\"3 Katie Bell 33333 55\")" << endl;
    cout << "addEmployee(\"2 Patrick Brown 22222 12.50 50\")" << endl;

    employees.addEmployee("4 Paul Johnson 44444 8.75 75");
    employees.addEmployee("1 Eric Hall 11111 1200.00");
    employees.addEmployee("3 Katie Bell 33333 55");
    employees.addEmployee("2 Patrick Brown 22222 12.50 50");

    pay = employees.calculateWeeklyPay();

    if (pay-3550.00 < .01) {
        cout << "Total Weekly Pay of 3500.00 for employees was calculated correctly" << endl << endl;;
        cout << "Using assignment operator: employees3 = employees" << endl;
        employees3 = employees;
        cout << "employees3.addEmployee(\"2 Georgia Jones 10111 13.50 40\")" << endl;
        employees3.addEmployee("2 Georgia Jones 10111 13.50 40");
        cout << "employees3.calculateWeeklyPay()" << endl;
        pay3 = employees3.calculateWeeklyPay();
        pay = employees.calculateWeeklyPay();
        if (((pay3 - 4090.00) < .01) && ((pay - 3550.00) < .01)) {
            cout << "Operator= working correctly, total Weekly Pay for employees3 = 4090.00\n"
                "and total Weekly Pay for employees is still 3500.00" << endl;
            returnResult = 0;
        }
        else {
            expectedString = "Total Weekly Pay(employees3): 4090.00.\n";
            expectedString += "Total Weekly Pay (employees): 3500.00\n";
            student = "Total Weekly Pay(employees3): " + to_string(pay3);
            student += "Total Weekly Pay (employees): " + to_string(pay);
            return false;
        }
    }

    else {
        expectedString = "Total Weekly Pay: 3550.00.\n";
        student = "Total Weekly Pay: " + to_string(pay);
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedPrintReportEmployee()
{
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;

    ifstream in;
    string line;
    string fileName = "employees.txt";
    string result;
    char result1[80];
    int empNum;
    double total;

    in.open(fileName);
    if (!in)
    {
        student = "Could not open file: " + fileName;
        expectedString = "Opened file: " + fileName + "\n";
        printResultsStr(returnResult, expectedString, student);
        return 1;
    }
    // read a line and add to employees
    while (!in.eof())
    {
        getline(in, line);
        employees.addEmployee(line);
    }
    // report
    istringstream inp(employees.printReport());
    inp.getline(result1, 80, '\n'); //"Weekly Pay Report for Pete's Pets"
    inp.getline(result1, 80, '\n'); // empty line
    inp.getline(result1, 80, '\n'); //"Employee      Weekly Pay"
    inp >> empNum;
    if (empNum != 11111)
    {
        expectedString = "First employee number should be 11111\n";
        student = empNum;
    }
    else
    {
        inp.getline(result1, 80, '\n'); // get the rest of the line
        inp >> empNum;
        if (empNum != 22222)
        {
            expectedString = "Second employee number should be 22222\n";
            student = empNum;
        }
        else
        {
            inp.getline(result1, 80, '\n'); // get the rest of the line
            inp >> empNum;
            if (empNum != 33333)
            {
                expectedString = "Third employee number should be 33333\n";
                student = empNum;
            }
            else
            {
                inp.getline(result1, 80, '\n'); // get the rest of the line
                inp >> empNum;
                if (empNum != 44444)
                {
                    expectedString = "Fourth employee number should be 44444\n";
                    student = empNum;
                }
                else
                {
                    inp.getline(result1, 80, '\n'); // get the rest of the line
                    inp.getline(result1, 80, '\n'); // empty line
                    inp >> result;                  //"Total"
                    inp >> result;                  //"payroll"
                    inp >> total;
                    if (((total - 3550.00) > .01))
                    {
                        expectedString = "total: 3500.00\n";
                        student = "total: " + to_string(total);
                    }
                    else
                    {
                        inp >> result; //"Managers"
                        inp >> total;
                        if (total != 1)
                        {
                            expectedString = "Managers: 1\n";
                            student = "Managers: " + to_string(total);
                        }
                        else
                        {
                            inp >> result; //"Clerks"

                            inp >> total;
                            if (total != 1)
                            {
                                expectedString = "Clerks: 1\n";
                                student = "Clerks: " + to_string(total);
                            }
                            else
                            {
                                inp >> result; //"Vets"
                                inp >> total;
                                if (total != 1)
                                {
                                    expectedString = "Vets: 1\n";
                                    student = "Vets: " + to_string(total);
                                }
                                else
                                {
                                    inp >> result; //"Sylist"
                                    inp >> total;
                                    if (total != 1)
                                    {
                                        expectedString = "Stylist: 1\n";
                                        student = "Stylist: " + to_string(total);
                                    }
                                    else returnResult =0;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}

int testPassedPrintReportEmployeeA()
{
    int returnResult = 1;
    string expectedString = "";
    string student = "";
    Employees employees;

    ifstream in;
    string line;
    string fileName = "employeesA.txt";
    string result;
    char result1[80];
    int empNum;
    double total;

    in.open(fileName);
    if (!in)
    {
        student = "Could not open file: " + fileName;
        expectedString = "Opened file: " + fileName + "\n";
        printResultsStr(returnResult, expectedString, student);
        return 1;
    }

    // read a line and add to employees
    while (!in.eof())
    {
        getline(in, line);
        employees.addEmployee(line);
    }
    // report
    istringstream inp(employees.printReport());
    inp.getline(result1, 80, '\n'); //"Weekly Pay Report for Pete's Pets"
    inp.getline(result1, 80, '\n'); // empty line
    inp.getline(result1, 80, '\n'); //"Employee      Weekly Pay"
    inp >> empNum;
    if (empNum != 11111)
    {
        expectedString = "First employee number should be 11111\n";
        student = empNum;
    }
    else
    {
        inp.getline(result1, 80, '\n'); // get the rest of the line
        inp >> empNum;
        if (empNum != 12345)
        {
            expectedString = "Second employee number should be 12345\n";
            student = empNum;
        }

        else
        {
            inp.getline(result1, 80, '\n'); // get the rest of the line
            inp >> empNum;
            if (empNum != 22222)
            {
                expectedString = "Third employee number should be 22222\n";
                student = empNum;
            }

            else
            {
                inp.getline(result1, 80, '\n'); // get the rest of the line
                inp >> empNum;
                if (empNum != 23456)
                {
                    expectedString = "Fourth employee number should be 23456\n";
                    student = empNum;
                }

                else
                {
                    inp.getline(result1, 80, '\n'); // get the rest of the line
                    inp >> empNum;
                    if (empNum != 33333)
                    {
                        expectedString = "Fifth employee number should be 33333\n";
                        student = empNum;
                    }

                    else
                    {
                        inp.getline(result1, 80, '\n'); // get the rest of the line
                        inp >> empNum;
                        if (empNum != 34567)
                        {
                            expectedString = "Sixth employee number should be 34567\n";
                            student = empNum;
                        }

                        else
                        {
                            inp.getline(result1, 80, '\n'); // get the rest of the line
                            inp >> empNum;
                            if (empNum != 44444)
                            {
                                expectedString = "Seventh employee number should be 44444\n";
                                student = empNum;
                            }
                            else
                            {
                                inp.getline(result1, 80, '\n'); // get the rest of the line
                                inp >> empNum;
                                if (empNum != 45678)
                                {
                                    expectedString = "Eighth employee number should be 45678\n";
                                    student = empNum;
                                }
                                else
                                {
                                    inp.getline(result1, 80, '\n'); // get the rest of the line
                                    inp.getline(result1, 80, '\n'); // empty line
                                    inp >> result;                  //"Total"
                                    inp >> result;                  //"payroll"
                                    inp >> total;
                                    if (((total - 6193.00) > .01))
                                    {
                                        expectedString = "The total should have been 6193.00\n";
                                        student = to_string(total);
                                    }
                                    else
                                    {
                                        inp >> result; //"Managers"
                                        inp >> total;
                                        if (total != 1)
                                        {
                                            expectedString = "The number of Managers should have been 1\n";
                                            student = to_string(total);
                                        }
                                        else
                                        {
                                            inp >> result; //"Clerks"

                                            inp >> total;
                                            if (total != 2)
                                            {
                                                expectedString = "The number of Clerks should have been 2\n";
                                                student = to_string(total);
                                            }
                                            else
                                            {
                                                inp >> result; //"Vets"
                                                inp >> total;
                                                if (total != 3)
                                                {
                                                    expectedString = "The number of Vets should have been 3\n";
                                                    student = to_string(total);
                                                }
                                                else
                                                {
                                                    inp >> result; //"Sylist"
                                                    inp >> total;
                                                    if (total != 2)
                                                    {
                                                        expectedString = "The number of Stylist should have been 2\n";
                                                        student = to_string(total);
                                                    }
                                                    else
                                                        returnResult = 0;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    printResultsStr(returnResult, expectedString, student);
    return returnResult;
}
int main(int argc, char *argv[])
{
    int passed = 1; // means fail

    cout << "Test Name: " << argv[1] << endl;

    if (strcmp(argv[1], "testPassedClerkNoOvertime") == 0)
    {
        passed = testPassedClerkNoOvertime();
    }
    else if (strcmp(argv[1], "testPassedClerkOvertime") == 0)
    {
        passed = testPassedClerkOvertime();
    }
    else if (strcmp(argv[1], "testPassedManager") == 0)
    {
        passed = testPassedManager();
    }
    else if (strcmp(argv[1], "testPassedVet") == 0)
    {
        passed = testPassedVet();
    }
    else if (strcmp(argv[1], "testPassedStylist") == 0)
    {
        passed = testPassedStylist();
    }
    else if (strcmp(argv[1], "testPassedCalcWeeklyPay") == 0)
    {
        passed = testPassedCalcWeeklyPay();
    }
    else if (strcmp(argv[1], "testPassedCopyconstructor") == 0)
    {
        passed = testPassedCopyconstructor();
    }
    else if (strcmp(argv[1], "testPassedEquals") == 0)
    {
        passed = testPassedEquals();
    }
    else if (strcmp(argv[1], "testPassedPrintReportEmployee") == 0)
    {
        passed = testPassedPrintReportEmployee();
    }
    else if (strcmp(argv[1], "testPassedPrintReportEmployeeA") == 0)
    {
        passed = testPassedPrintReportEmployeeA();
    }

    return passed; // if 0 then test passed
}

 
does each dervied class need a copy constructor ? cause reading the project description it seems like i do