#pragma once
class Employee
{
private:
char name[20];
int empNo;
float salary;
public:
Employee(){}
Employee(char* _name, int _empNo, float _salary);
Employee(char* amy, int 2, float 1000){}
Employee(Employee & emp);
string setName(char* _name);
void setEmpNo(int _empNpo);
void setSalary(float _salary);
char* getName();
int getEmpNo();
float getSalary();
void display();
};
#include"employee.h"
#include<string>
#include<iostream>
using namespace std;
Employee::Employee(char* _name, int _empNo, float _salary)
{
strcpy_s(name, _name);
empNo = _empNo;
salary = _salary;
}
string Employee::setName(char* _name)
{
strcpy_s(name, _name);
}
void Employee::setEmpNo(int _empNo)
{
empNo = _empNo;
}
void Employee::setSalary(float _salary)
{
salary = _salary;
}
char* Employee::getName()
{
return name;
}
int Employee::getEmpNo()
{
return empNo;
}
float Employee::getSalary()
{
return salary;
}
void Employee::display()
{
cout << name << "," << empNo << "," <<salary << endl;
}