0
Help guys m gna post mny questions. I need help.click to see my question it is long
code a c++ program to capture 10 employee information from the user and then display the information which was entered by the user. in your program include the following fields (Employee_Id_no, sex and age)NB:the program must use structures
2 Réponses
0
basic version should look like this.
typedef struct s_Employee {
int Employee_id_no;
char sex; //M for male F for female
int age;
} Employee;
int main (void)
{
Employee employee[10];
for (int i = 0; i < 10; i++)
{
cout << "Input sex, M for male, F for female ";
cin >> employee[i].sex;
cout << " Input age ";
cin >> employee[i].age;
employee[i].Employee_id_no = i;
}
//Printing out employee informations
for (int i = 0; i < 10; i++)
{
cout << "Id: " << employee[i].Employee_id_no << endl;
cout << "Sex: " << employee[i].sex<< endl;
cout << "Age: " << employee[i].age << endl << endl;
}
}
It may contain some errors, since i didn't compile, buy you get idea.
0
thnks mladen stupar