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

this is part 2 of the question i just asked asked. c++ Part 2 Class lab: faculty

ID: 3601404 • Letter: T

Question

this is part 2 of the question i just asked asked. c++

Part 2 Class lab: faculty Type Your lab will have 2 files: 1) facultyIype.h and 2) a cpp file with the main program You must write the faculty Type h file. The code for the main program is below. Run the program in Visual C++ as described above. When it works, email both the header file and the .cpp source file to Mrs. Hughes The class faculty Type has private variables for first name, last name and department of a faculty member. Another variable holds the salary, and finally a variable gives the number of years of service. The functions that change data (modifyALL and changeSalary) will get user keyboard input for the new values #include #include using namespace std; #include "faculty-rype.h" int main facultyType fac1; facultyType fac2("Betty", "Thomas", "BIOL", 55750, 5); fac1 print0: fac2.printO: fac1.modifyALLO: fac2.changeSalaryO: fac1 printO fac2.print0: system("pause"); return 0

Explanation / Answer

Here is the .h file for you:

#include <iostream>
using namespace std;
class facultyType
{
    private:
        string firstName;
        string lastName;
        string department;
        double salary;
        int serviceYears;
       
    public:
        facultyType();   //Default constructor.
        facultyType(string, string, string, double, int);   //Parameterized constructor.
       
        void print();   //Print function which takes no parameters, and returns nothing.
       
        void modifyALL();   //Function which sets all the class attributes.
        void changeSalary();   //Function to change the salary alone.
};