Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

anyone who knows payroll program in dev c++?

OpenStudy (anonymous):

@timo86m ?

OpenStudy (anonymous):

i do a bit :)

OpenStudy (anonymous):

Is it for class or your own stuff?

OpenStudy (anonymous):

yes

OpenStudy (anonymous):

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

OpenStudy (anonymous):

its for my class

OpenStudy (anonymous):

This seems pretty easy. Just use classes. class employee { ... };

OpenStudy (anonymous):

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,

OpenStudy (anonymous):

#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.

OpenStudy (anonymous):

thank you so much, but wt about computation?

OpenStudy (anonymous):

that is easy.

OpenStudy (anonymous):

how?

OpenStudy (anonymous):

still their?

OpenStudy (anonymous):

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 };

OpenStudy (anonymous):

thanks

OpenStudy (anonymous):

your a life saver !!!

OpenStudy (anonymous):

{ 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; };

OpenStudy (anonymous):

thank you so much :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!