vendredi 16 septembre 2022

i am trying to display employees based on their designation like hr,developer like that i tried a code but it is not displaying output

iam trying to display employees based on their designation like hr,developer like that i tried a code but it is not displaying output

void searchDeptReport()
{
    system("cls");
    char department[20];
    int i;
    ;
    bool found = false;
    cout << "\nYou can Search only through the designation of Employees\n\n";
    cout << "\nEnter the Department to get report : ";
    cin >> department;
    for (int i = 0; i <= num - 1; i++)
    {
        if (emp[i].designation == department)
        {
            cout << "\nName\t  Emp ID\tGender\t Designation " << endl;
            cout << "------------------------------------------------\n";
            gotoXY(0, 7);
            cout << "Name : " << emp[i].name << endl;
            gotoXY(11, 7);
            cout << "Employee Id : " << emp[i].code << endl;
            gotoXY(21, 7);
            cout << "Gender : " << emp[i].gender << endl;
            gotoXY(35, 7);
            cout << "Designation : " << emp[i].designation << endl;
            found = true;
            cout << "\n\nPress Any key for Menu..";
        }
    }

    if (!found)
    {
        cout << "\n\nNo records Found...!!!\a";
        cout << "\n\nPress Any key for Menu..";
    }
    getch();
}

enter image description here

Aucun commentaire:

Enregistrer un commentaire