1

here is my code, im still getting an error and had no idea what to do! what im trying to do is to make 4 function to get the total net of a certain employee, wherein I could loop and used the form as many times as the no. I input in no. of employee...where in it could process the employee position, the hours late and days work which has a rate as indicated in my program to get the gross,
and secondly by deducting the total salary deduction to get the total net of a certain employee...hope this clears out my intentions!thank

# include <iostream.h>
void company_name(void);
int no_emp();
main ()
{
int company_name(void);
int no_emp(int e);
return 0;
}
void company_name(void)
{
cout<<"Company Name \n";
}
int no_emp(int e)
{
cout<<"enter no. of employee:";
cin>>no_emp(int e);
return (no_emp);
int loop (no_emp);
}
int x,rate;
char pos;
int loop (no_emp)
{
for (x=1;x<=e;x++);
{
cout<<"M-Manager S-Supervisor T-Staff \n";
cout<<"Position";cin>>pos;
if(pos=='m'){rate=400;}
else if (pos=='s'){rate=350;}
else{
rate=300;}
return 0;}
double dw,hl,gross,sss=300,net,misc=100,sd;
double tax;
cout<<"Enter Days of worked";
cin>>dw;
cout<<"Enter Hours Late";
cin>>hl;
hl=(rate/8)*hl;
gross=rate*dw;
cout<<"Salary Deduction\n";
cout<<"SSS:"<<sss<<"\n";
tax=gross*.10;
cout<<"Tax:"<<tax<<"\n";
cout<<"Miscellaneous:"<<misc<<"\n";
cout<<"Late"<<hl<<"\n";
sd=sss+tax+pagibig+hl;
net=gross-sd;
cout<<"NET:"<<net;
return (e);
}
Votes + Comments
post #1 and code-tags!
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Nick Evan
0

Quite a few errors actually.
Perhaps you should look at a tutorial for functions first.

But because you took the time to learn about code-tags (good job!), I'll give you a start on your program:

# include <iostream>

using namespace std;

void company_name(void);
int no_emp(void);

int main ()
{
    company_name();
    int e =  no_emp();
    cout << "number of employees: " << e;
    cin.ignore();
    cin.get();
    return 0;
}
void company_name(void)
{
    cout<<"Company Name \n";
}

int no_emp()
{
    int number_of_emp;
    cout<<"enter no. of employee:";
    cin>>number_of_emp ;
    return number_of_emp;
}

Study this example and compare it to the code you created. That way you can easily see where your errors are/were.

Also this: # include <iostream.h> probably means that you're using TurboC++ ? I would strongly suggest that you upgrade to a compiler from this millenium.
A few free ones are:
Visual Studio
Code::blocks
Dev-C++

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.