Popular Download

Jul 3, 2011

Simple Payroll System Using OOP in C++

this code is for tutorial only
the fuction of the code is multiply the number of day for the employee
more comment post here or like us on f and follow us on twitter


#include iostream.
#include iomanip


using namespace std;


class payroll {

    private:

    string name;
    int days_work;
    float rate;
    float solve;

    public :

      int get_info();
      void display_info();
};

 int payroll :: get_info()
 {
     cout << "\t\t Simple Payroll System Using OOP in C++";

     cout << "=========================================================\n\n";
     cout << "Enter Employees Name     : ";
     getline(cin,name);
     cout << "Enter No. of Days Worked : ";
     cin >> days_work;
     cout << "Enter Daily Rate         : ";
     cin >> rate;
     cout << fixed << setprecision(2);
     solve = (days_work * rate);
 }

 void payroll ::display_info()
    {

     cout << "\n\n";
     cout << "==== DETAILED REPORT =====";
     cout << "\n\n";
     cout << "\nEmployees Name     : " << name;
     cout << "\nEmployees Salay is : P" << solve;
     cout << "\n\n";
     system("pause");
    }


    main() {
        payroll emp;
        emp.get_info();
        emp.display_info();

    }