Pages

100 Contemporary Living Room Designs

Thursday, September 13, 2012

C++ PROGRAM TO CALCULATE EMPLOYEE NET SALARY



Given that an EMPLOYEE class contains following members:
Data members : Employee_Number, Employee_Name, Basic, DA,

IT, Net_Salary

Member functions: to read the data, to calculate Net_Salary and to print data members.
Write a C++ program to read the data of N employees and compute Net_Salary of each employee.

(Dearness Allowance (DA) = 52% of Basic and Income Tax (IT) = 30% of the gross salary. Net_Salary = Basic + DA - IT)


https://d2498fijg8ztfy3etotznbpl9t.hop.clickbank.net/?tid=MATBIN

#include<iostream.h>
#include<conio.h>
#define SIZE 5

class emp
  {
     float basic,da,it,netsal;
     char name[20],num[10];
     public:
         void getdata();
         void net_sal();
         void dispdata();

  };

void emp::getdata()
    {
      cout<<"\n            Enter employee number: " ;
      cin>>name;
      cout<<"              Enter employee name: " ;
      cin>>num;
      cout<<"Enter employee basic salary in Rs: " ;
      cin>>basic;
    }

void emp::net_sal()
    {
      da=((0.52)*basic );
      float gsal=da+basic;
      it=((0.3)*gsal);
      netsal=gsal-it;
    }

void emp::dispdata()
    {
      cout
            <<"\n      Employee number: "<<name
            <<"\n        Employee name: "<<num
            <<"\n   Employee netsalary: "<<netsal<<" Rs.";

    }

void main()
  {
     clrscr();
     emp ob[SIZE];
     int n;
     cout<<"\n\n***********************************"
         <<"\nCalculation of Employee Net Salary"
         <<"\n***********************************"
         <<"\n Enter the number of employees";
     cin>>n;
     for(int i=0;i<n;i++)
         {
            ob[i].getdata();
            ob[i].net_sal();
         }
     clrscr();
     cout<<"\n-----------------"
         <<"\nEmployee Detail::"
         <<"\n-----------------";
     for( i=0;i<n;i++)
          {
            cout<<"\n\n Employee:"<<i+1
                <<"\n ----------";
            ob[i].dispdata();
          }
     getch();
  }





OUTPUT



13 comments:

  1. Write a program to make a calculator by operator in not argument nor return function .help me

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. give me a program which make the odd numbers 1 to 100

    ReplyDelete
    Replies
    1. https://programscpp.blogspot.com/2018/12/blog-post.html

      Delete
  4. write a c++ program to calculate family income using friend function please suggest me

    ReplyDelete
  5. give me the coding if salary is 3000 and the absent days of employee is 10 days and total salary is 2000

    ReplyDelete
  6. give me the coding if salary is 3000 and the absent days of employee is 10 days and total salary is 2000

    ReplyDelete
  7. https://d2498fijg8ztfy3etotznbpl9t.hop.clickbank.net/?tid=MATBIN

    ReplyDelete
  8. (b). Employees of a certain firm are paid on hourly basis at the end of each week. If an employee works up to 40hrs the employee is paid 6 cedis and 7 cedis per hour for a male and female respectively.
    If an employee works for more than 40 hours then the employee is also paid 1.5 the corresponding regular rate for hours worked in excess of 40. All employees are to pay 15 % of their gross as INCOME TAX and 5% towards the NHIS. If an employee has more than 3 children then he or she pays 2 cedis per child in excess of three towards GETFUND.

    Write a C++ program in can output an employee’s gross pay, various deduction (INCOME TAX, NHIS,GETFUND) and the NET PAY with appropriate caption. (You are required to use user-defined functions for all the outputs and the deductions).

    ReplyDelete
  9. (b). Employees of a certain firm are paid on hourly basis at the end of each week. If an employee works up to 40hrs the employee is paid 6 cedis and 7 cedis per hour for a male and female respectively.
    If an employee works for more than 40 hours then the employee is also paid 1.5 the corresponding regular rate for hours worked in excess of 40. All employees are to pay 15 % of their gross as INCOME TAX and 5% towards the NHIS. If an employee has more than 3 children then he or she pays 2 cedis per child in excess of three towards GETFUND.

    Write a C++ program in can output an employee’s gross pay, various deduction (INCOME TAX, NHIS,GETFUND) and the NET PAY with appropriate caption. (You are required to use user-defined functions for all the outputs and the deductions).

    ReplyDelete
  10. 1. Write a c++ program that compute the Income, Deduction and net payment of employee for a given salary.

    ReplyDelete