help

Write your question here.
Write a C++ code to implement the following tasks:
1. The company ABC wants to develop an employee management system. The company has the
departments: Sales, Admin and IT. The designations are: executive and manager.
An employee has the attributes:
employeeId
name
department
designation
basicSalary
commission
totalSalesAmount
medicalAllowance
houserent

If the employee is in sales department there will be a commission. No other department has
commission. The commission is based on the totalSalesAmount. Consider the chart below:
Department Designation Basic Salary House Rent Medical
Commission
(on Total Sales)
Sales
Executive 10000.0 50% of Basic 500.0 20%
Manager 20000.0 60% of Basic 1000.0 30%
Others
Executive 10000.0 50% of Basic 500.0
0%
Manager 20000.0 60% of Basic 1000.0
You need to design necessary class for this management system and demonstrate the salary
statement for each type of employee.
INPUT & OUTPUT FORMAT
The typical output is as follows:
-----------------------------------------------------------------
***Pay Slip***
Employee Id: 1001
Employee Name: ABC
Department: Sales
Designation: Executive
Basic: 10000.0
House Rent: 5000.0
Medical: 500.0
Total Sales Amount is Tk. 25000.0
Commission: 5000.0
---------------------------------------------
Total Salary: 23000 Tk.
---------------------------------------------
***End of Pay Slip***
-----------------------------------------------------------------
The Structure of your code should follow:
class Employee{
//Private Fields
//Public Constructor or Constructors
//Public Setters & Getters
//Public Functions
// Public Destructor
}
int main(void){
//Creation of Objects
//Set values
//Compute Commission
//Compute total Salary
//Print the Pay Slip
//Releasing all the Memory

return 0;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  assignment 2
#include<iostream>
using namespace std;
class employee
{
 private:
   string employeeId;
   string name;
   string department;
   string designation;
   float basicSalary;
   float commission;
   int totalSalesAmount;
   float medicalAllowance;
   float houseRent;
   
   public:
       employee()
       {
   employeeId=" ";
   name="";
   department="";
   designation="";
   basicSalary=0.0;
   commission=0.0;
   totalSalesAmount=0;
   medicalAllowance=0.0;
   houseRent=0.0;
       }
       
  employee(string empId,string na,string dep,string desi,float basicsa,float commi,int totalSalesAm,float medical,float house)
   {
   employeeId=empId;
   name=na;
   department=dep;
   designation=desi;
   basicSalary=basicsa;
   commission=commi;
   totalSalesAmount=totalSalesAm;
   medicalAllowance=medical;
   houseRent=house;
   }
   
   void setvalue(string empId,string na,string dep,string desi,float basicsa,float commi,int totalSalesAm,float medical,float house)
   {
   employeeId=empId;
   name=na;
   department=dep;
   designation=desi;
   basicSalary=basicsa;
   commission=commi;
   totalSalesAmount=totalSalesAm;
   medicalAllowance=medical;
   houseRent=house;
   }
   
   
   
   
   
    
};



then where do start ?
Last edited on
Why is totalSales Amount an integer instead of a float?

You're supposed to write public setters and getters. That means methods to set/get each of the private members.

Looking at the requirements, I'd write methods to:
- compute commission
- compute total compensation
- print a pay slip.
Topic archived. No new replies allowed.