Friday, December 18, 2020

Payroll System in C++ Using OOP Approach

  Machine Problem in C++

  Write a program to ask the user to give the employee's name, the number of days work, and rate per day. The program will compute the salary of the employee using object-oriented programming approach in C++.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking, and Arduino Project development at a very affordable price. My website is www.jakerpomperada.blogspot.com and www.jakerpomperada.com

If you like this video please click the LIKE button, SHARE, and SUBSCRIBE to my channel.

Your support on my channel is highly appreciated.

Thank you very much.





Program Listing

/* 

 Machine Problem in C++
 
 Write a program to ask the user to give the employees name,
 number of days work, and rate per day. The program will
 compute the salary of the employee using object-oriented
 programming approach in C++.
 
 payroll.cpp
 Mr. Jake Rodriguez Pomperada, MAED-IT,MIT
 www.jakerpomperada.com
 www.jakerpomperada.blogspot.com
 jakerpomperada@gmail.com
 Bacolod City, Negros Occidental Philippines
 
 */

#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 << "\n\n";
     cout << "\tPayroll System in C++ Using OOP Approach";
     cout << "\n\n";
cout << "\tEnter Employees Name     : ";
     getline(cin,name);
     cout << "\tEnter No. of Days Worked : ";
     cin >> days_work;
     cout << "\tEnter Daily Rate         : ";
     cin >> rate;
     cout << fixed << setprecision(2);
     solve = (days_work * rate);
 }

 void payroll ::display_info()
    {

     cout << "\n\n";
     cout << "\t==== DETAILED REPORT =====";
     cout << "\n\n";
     cout << "\tEmployees Name     : " << name <<"\n";
     cout << "\tEmployees Salay is : $" << solve <<"\n";
     cout << "\n\n";
    }


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

    }



No comments:

Post a Comment