anyone who knows payroll program in dev c++?
@timo86m ?
i do a bit :)
Is it for class or your own stuff?
yes
input:employee name No. hours worked Extra service hour No. hours late Rate per hour food deduction extra income OUTPUT: employee name under time pay extra income gross pay netpay COMPUTATION: tax=12% of gross pay sss=7% of gross pay philhealth = 5% of gross pay insurance=3% of gross pay pag ibig=1.8% of gross pay overtime rate=additional3% of regular rate per hour undertime pay= No. hours late * Rate per hour grosspay= No. hours worked*rate per hour+ overtime pay deduction= undertime pay + pag ibig + philhealth + sss + insurance + tax + food deduction net pay = gross pay - deduction + extra income
its for my class
This seems pretty easy. Just use classes. class employee { ... };
actually im mechanical eng. student, so im not really sure wat im doing, it's a minor subject but it will be our take home exam,
#include <iostream> #include <cstdio> using namespace std; class employee // has to be in global scope { public: //dont forget to make them public char name[]; int pay; int social; int hours; //items here }; int main() { employee emp1; // make a user defined object called emp 1. cout << "name: "; cin >>emp1.name; // use objname.item to access it. cout << "pay: "; cin >> emp1.pay; //... return 0; } this is a working console program. Just fill in what is missing. And ask me more qs if you want.
thank you so much, but wt about computation?
that is easy.
how?
still their?
yes before you go on add a contructor for your constants. class employee // has to be in global scope { public: //dont forget to make them public // constants double tax; double sss; // char name[]; int pay; int social; int hours; employee(){tax=.12; sss=.07;};// constructor for constants and such //items here };
thanks
your a life saver !!!
{ public: //dont forget to make them public // constants double tax; double sss; // char name[]; int pay; int social; double hours; double rate; employee(){tax=.12; sss=.07;};// constructor for constants and such //items here // functions double undertime( double a, double b) {return hours* rate;} // very simple, but i'd include // some kind of if statement to check for less than 40 hours; };
thank you so much :)
Join our real-time social learning platform and learn together with your friends!