hey all i am new to all this languages and Computer sciences so if you help me
i am trying to write a code and its constantly giving me errors here is the code
at line 10 , 102 , 115 tell me how to fix it.. waiting...
#include<iostream.h>
void get_input(double sal[][2], int numemps);
void calc_net_sal(double sal[][2], int numemps);
void find_unluckies(double sal[][2], int numemps, int lucky[]);
void mark_if_unlucky(double sal[][2], int numemps, int lucky[], int upperbound, int empnbr);
void print_unluckies(int lucky[], int numemps)
void main(void)
{
const int arraysize=100;
double sal[arraysize][2];
int lucky[arraysize] = {0};
int numemps;
// getting input abt the total number of employs
cout<<"\n please enter the total number of employs in your company :";
cin>>numemps;
cout<<"\n";
/* read the gross salaries of the employes in the array 'sal'*/
get_input(sal, numemps);
// calculation of net salaries of the employees and storing them in array
cout<<"\n\n locating the unlucky employees...";
find_unluckies(sal, numemps, lucky);
print_unluckies(lucky, numemps);
//printing the unlucky employees
cout<<"\n\n printing the unlucky employees";
print_unluckies(lucky, munemps);
}
void get_input(double sal[][2], int numemps)
{
for(int i = 0; i < numemps; i++) //numemps is local for this function
{
cout<<"\n please enter the gross salary for employee number "<<i<<":";
cin>> sal[i][0];
}
}
void calc_net_sal(double sal[][2], int numemps)
{
for(int i=0; i < numemps; i++) //numemps is local for this function
{
if(sal[i][0] >= 0 && sal[i][0] <= 5000)
{
//no tex deduction
sal[i][1]= sal[i][0];
}
else if(sal[i][0] >= 5001 && sal[i][0] <=10000)
{
//5% tax will be deducted
sal[i][1] = sal[i][0] -(.05 *sal[i][0]);
}
else if(sal[i][0] >=10001 && sal[i][0] <=20000)
{
//10% tax deduction
sal[i][1] = sal[i][0] -(.10 * sal[i][0]);
}
else if(sal[i][0] >=20001)
{
//15% tax deduction
sal[i][1] = sal[i][0] -(.15 * sal[i][0]);
}
else
{
//no need to do anything here
}
}
}
void find_unluckies(double sal[][2], int numemps, int lucky[])
{
for(int i = 0 ; i < numemps; i++) //numemps is local for this function
{
if(sal[i][0] >= 0 && sal [i][0] <= 5000)
{
//no need to chk for unlucky employees
}
else if(sal[i][0] >= 5001 && sal[i][0] <= 10000)
{
mark_if_unlucky(sal, numemps, lucky, 5001, i);
}
else if(sal[i][0] >= 10001 && sal[i][0] <= 20000)
{
mark_if_unlucky(sal, numemps, lucky, 10001, i);
}
else if(sal[i][0] >= 20001)
{
mark_if_unlucky(sal, numemps, lucky, 20001, i);
}
}
}
void mark_if_unlucky(double sal[][2], int numemps[], int lucky [], int upperbound, int empnbr)
{
for( int i = 0 ; i < numemps; i++)
{
if(sal[i][0] < upperbound && sal[i][1] >= sal[empnbr][1])
{
lucky[empnbr] = 1; // employee marked as unlucky
break;
}
}
}
void print_unluckies(int lucky[], int numemps)
{
for(i = 0; i < numemps; i++)
{
if(lucky[i] == 1)
{
cout<<"\n employee no. : <<i";
}
}
}