Worker's S Salary (C++)
Worker's S Salary (C++)
Worker's S Salary (C++)
h>
#include <iostream>
class Employ
{
int no;
char name[40];
char lastname[40];
double salary;
int hour;
public:
void noSet(int var)
{
no = var;
}
void nameSet(char* var)
{
strcpy_s(name, var);
}
void lastnameSet(char* var)
{
strcpy_s(lastname, var);
}
void salarySet(double var)
{
salary = var;
}
void hourSet(int var)
{
hour = var;
}
int noGet()
{
return no;
}
char* nameGet()
{
return name;
}
char* lastnameGet()
{
return lastname;
}
double salaryGet()
{
return salary;
}
int hourGet()
{
return hour;
}
double Bime()
{
return (salary * 7) / 100;
}
double Tax()
{
return (salary * 5) / 100;
}
double SalaryOnHour()
{
return salary * hour;
}
double TotalSalary()
{
return SalaryOnHour() - (Tax() + Bime());
}
};
void main()
{
Employ person;
int x;
double y;
char z[40];
cout << "Please Enter Data For Employ ... " << endl << "Employ id : ";
cin >> x;
person.noSet(x);
cout << "Employ : " << person.noGet() << " - " << person.nameGet() << " " <<
person.lastnameGet() << " ~ Total Salary = " << person.TotalSalary() << endl;
}