help me :) to complete this program

hey guys

this program dont do anything in function whats the problem !?
and how i can fix a salary function cuz mybe it does not work successfully
in menu driven the functions not work why ?! and how i can fix it please

help me :)



#include<iostream>
#include<string>
using namespace std;

int counter=0;
string *department;
double *salary;
string *firstname;
string *lastname;
string *fullname;
double y;

void addemp(string name1,string name2,double salary1,string department1,string fullname)
{

firstname[counter]=name1;
lastname[counter]=name2;
salary[counter]=salary1;
department[counter]=department1;
fullname=firstname[counter]+lastname[counter];
counter++;
}


void employeedep(string department1)
{
int counter=1;
department=new string[counter];
for(int i=0;i<counter;i++)
{
if(department1==fullname[counter])
cout<<department1;
else
counter++;
}
}


void incsalary(double salary[])
{
for(int i=0;i<counter;i++)
{
y=y*salary[counter];
counter++;

}
}


void print()
{
for(int i=0;i<counter;i++)
{
cout<<fullname[counter]<<endl;;
cout<<department[counter]<<endl;
cout<<salary[counter]<<endl;
}
}



void main()
{

cout<<"please inter the size of employee"<<endl;
int size;
cin>>size;
department=new string[size];
salary=new double[size];
firstname=new string[size];
lastname=new string[size];
cout<<"please insert the employee name"<<endl;
string firstname,lastname;
string department;
double salary;
cin>>firstname>>lastname;
cout<<"please insert the salary you want to add "<<endl;
cin>>salary;
cout<<"please insert the department of employee"<<endl;
cin>>department;
int x;

while (1)
{
cout<<"please insert your step"<<endl;
cout<<"please to add new employee please press 1"<<endl;
cout<<"please to set the depardment please press 2"<<endl;
cout<<"please to add the salary please press 3"<<endl;
cout<<"please to print all information please press 4"<<endl;
cout<<"to exit please press 5"<<endl;
cin>>x;

switch(x)
{


case 1:
void addemp(string name1,string name2,double salary1,string department1,string fullname);
break;



case 2:
void employeedep(string department2);
break;



case 3:
cout<<"PLEASE INSERT THE RAISE THE SALARY"<<endl<<endl;
cin>>y;
void incsalary(double salary);

break;



case 4:

print();

break;



case 5:

exit(0);

break;


}

}

}



Topic archived. No new replies allowed.