Question
Add search functionality to your program according to the user inputs and display only the employees that satisfy what the user looks for. social security,
Add search functionality to your program according to the user inputs and display only the employees that satisfy what the user looks for. social security, first name, or above a certain salary.
I have included the program so far and the text file it is reading. I just need the function base. I was going to implement a switch case to the different types of search
#include #include #include #include #include #include #include using namespace std; //Declaring Employee Structure struct Employee { //Declaring variables string role; string first; string last; int salary; string socialSecurity; char employee_code; string department; }; int main() {
//Declaring variables int i=0; ifstream dataIn; const int SIZE=1000;\
//Opening the input file dataIn.open("employee.txt"); //checking whether the file name is valid or not if(dataIn.fail()) { cout
//Creating the struct array Employee emps[SIZE]; //Reading the data from the file while(!dataIn.eof()) {
dataIn>>emps[i].employee_code>>emps[i].socialSecurity>>emps[i].first>>emps[i].last; dataIn>>emps[i].department>>emps[i].role>>emps[i].salary;
i++; } dataIn.close();
//Displaying the data in the struct array for(int j=0;j { cout
return 0; }
hann employee - Notepad File Edit Format View Help $ 135-25-1234 Sophia Smith 135-67-5462 Jacob Johnaon 252-34-6728 Emma William 237-12-1289 Mason Miller S 581-23-4536 Jayden Jones 501-56-9724 Mia Rogers 408-67-8234 Choloe Cook 516-34-6524 Daniel Morris 526-47-2435 Natalie Smit 530-46-8245 Grace Johnson 035-35-6472 Avery Allen S 222-35-9324 Joshua Youn S 407-36-1285 Elijah Hall 251-98-2836 Davia Wright S 627-67-9879 Andrew Rogers 509-45-0909 Joshua Park S 408-12-8976 Stewart Thomson S 425-90-2010 Sanjeev Sharma 433-44-2324 Sandra Sellters 486-88-9981 Dennis Arthur S 478-77-2763 Daniel Weaver S 505-55-8786 Amanda Byron S 429-30-3678 Megan Finley DevOps Developer SecOps Pentester DevOps DBExpert DevOps CloudArchitect SecOps Pentester DevOps Auditor DevOps QAEngineer DevOps ProductOwner DevOps Developer Secops SecurityEngineer DevOps Technical Lead DevOps ScrumMaster DevOps QAEngineer Devops CloudArchitect Devops SystemAdmin SecOps SecurityArchitect DevOps Deployment Engineer DevOps Worldwide Lead AccountFinance AccountingManager AccountFinance Accountant Sales SalesManager Sales SalesAssociate Administration OfficeManager 70000 130000 100000 80000 250000 90000 100000 300000 130000 300000 250000 150000 100000 200000 100000 250000 250000 350000 200000 60000 70000 70000 80000Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started