•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 402,970 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,723 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 151 | Replies: 1
![]() |
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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);
}•
•
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,630
Reputation:
Rep Power: 8
Solved Threads: 168
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:
Study this example and compare it to the code you created. That way you can easily see where your errors are/were.
Also this:
A few free ones are:
Visual Studio
Code::blocks
Dev-C++
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:
cpp Syntax (Toggle Plain Text)
# 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++
Want better/more replies to your questions? Wrap your code in [code] [/code] tags!
do NOT pm me for help, in the best case, you'll get ignored
do NOT pm me for help, in the best case, you'll get ignored
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- VB's Left, Right, Mid Functions in C++? (C++)
- User defined functions (C++)
- Double Linked Lists and Functions required (C++)
- How to write FNVAL functions (Java)
- I dont see any difference between these 2 functions, DO YOU? (C)
- access Digital Camera Functions (C++)
Other Threads in the C++ Forum
- Previous Thread: problem in Release mode
- Next Thread: vectors question



Linear Mode