C C C Create a class called consultCo that holds a private s

C++ C++ C++

Create a class called consultCo that holds a private struct called employee that contains the name, pay rate and social security number of an employee of a consulting firm called consultCo. The consultCo class should also have a vector that holds all of the objects of all of the employees in the vector. This will be a vector of employee objects.   The consultCo class must be enclosed in a custom namespace. You can choose the name of the namespace.

Here is a logical diagram of this vector of objects:

Minimum Requirements:

An add function to hire a new employee. This function should create a new object with the employee information (name, payrate and social security number) and then it should add that new object to the vector. You are not required to update an employee’s data if the employee exists.

A report function that will display the name, pay rate and social security number of all employees.

A raise function that will give all employees a 10% raise.

also need a main function that creates calls the function(s) you created to meet the requirements of this project

object of the employee class Jones name 12.5 Pay rate SSN vector of objects Liang avis Allen (objects may contain 15.4. 13.2 12.9 LE3aasd more than one type)

Solution

#include <iostream>
#include <cstdlib>
#include <string>

using namespace std;

class EMPLOYEE
{
public:
EMPLOYEE();//
EMPLOYEE(string name, int salary);//


public:
string name;//name to be input
int salary;//salary to be input

public:
int enter_values();
int output_values();
int NEW_SALARY( int percentage_raise);

};


//default constructor
EMPLOYEE::EMPLOYEE()
{
name = \"\";
salary = 0;
}

//constructor with name/salary variables
EMPLOYEE::EMPLOYEE(string NAME, int SALARY)
{
name= NAME;
salary= SALARY;
}

//name and salary to be input...
int EMPLOYEE::enter_values()
{ cout<<\"Enter name and salary: \";
cin>> name;
cin>>salary;

}

//output

int EMPLOYEE::output_values()
{ cout<<\"Name: \"<<name<<endl;
cout<<\"Salary: \"<<salary<<endl;


}


//
int EMPLOYEE::NEW_SALARY(int percentage_raise)
{

EMPLOYEE updated_salary;

if ( percentage_raise >= 0)
{
int raise = (salary*percentage_raise)/100;
salary += raise;
}


}

else if(percentage_raise< 0)
{ cout<<\"Error Message\"<<endl;

}

return percentage_raise;
}

int main()
{
EMPLOYEE employees[100];
int percent= 0;
employees[i].NEW_SALARY(percent);
int i;
for(i =0 ;i<100 ; i++)
{ employees[i]=EMPLOYEE();
employees[i].enter_values();
employees[i].name;
employees[i].salary;

employees[i].output_values();


cout<<\"How much should the salary be raised by?\"<<endl;

cin>>percent;
cout<<employees[i].name<<\"\'s new salary is \"<<employees[i].salary<<endl;
}

}

C++ C++ C++ Create a class called consultCo that holds a private struct called employee that contains the name, pay rate and social security number of an employ
C++ C++ C++ Create a class called consultCo that holds a private struct called employee that contains the name, pay rate and social security number of an employ
C++ C++ C++ Create a class called consultCo that holds a private struct called employee that contains the name, pay rate and social security number of an employ

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site