File Handling with struct(all codes should be c++ using linux server) Basically my code is incomplete and i cant do like the output. I need help combining the data into code with step by step This...



File Handling with struct(all codes should be c++ using linux server)


Basically my code is incomplete and i cant do like the output. I need help combining the data into code with step by step



This program is to read a given file and display the information about employees according to the type of employee. Specifically, the requirements are as follows.



1. Read the given file of the information of employees.



2. Store the information in an array or arrays.



3. Display a table header and then all the salaried employees first and the hourly employees



4. Prompt the user to enter an SSN and find the corresponding employee and display the information of that employee.



SAMPLE OUTPUT




Qap: \( = \) 3 \( =2 \pm \mathrm{I} \cdot \mathrm{CF} \) The Shae of empinipes 1S 23​​​​​​​



EMPLOYEE


S 135-25-1234 Smith Sophia DevOps Developer 70000
H 135-67-5462 Johnaon Jacob SecOps Pentester 30 60.50
S 252-34-6728 William Emma DevOps DBExpert 100000
S 237-12-1289 Miller Mason DevOps CloudArchitect 80000
S 581-23-4536 Jones Jayden SecOps Pentester 250000
S 501-56-9724 Rogers Mia DevOps Auditor 90000
S 408-67-8234 Cook Chloe DevOps QAEngineer 40 45.10
S 516-34-6524 Morris Daniel DevOps ProductOwner 300000
H 526-47-2435 Smith Natalie DevOps Developer 30 50.25
S 530-46-8245 Johnson Grace SecOps SecurityEngineer 300000
S 035-35-6472 Allen Avery DevOps TechnicalLead 250000
S 222-35-9324 Youn Joshua DevOps ScrumMaster 150000
S 407-36-1285 Hall Elijah DevOps QAEngineer 100000
S 251-98-2836 Wright David Devops CloudArchitect 200000
H 627-67-9879 Rogers Andrew Devops SystemAdmin 50 40.30
S 509-45-0909 Lee Joshua SecOps SecurityArchitect 250000
S 408-12-8976 Thomson Stewart DevOps DeploymentEngineer 250000
S 425-90-2010 Sharma Sanjeev DevOps WorldwideLead 350000
S 433-44-2324 Sellters Sandra AccountFinance AccountingManager 200000
S 486-88-9981 Arthur Dennis AccountFinance Accountant 60000
H 478-77-2763 Weaver Daniel Sales SalesManager 30 25.50
S 505-55-8786 Byron Amanda Sales SalesAssociate 70000
S 429-30-3678 Finley Megan Administration OfficeManager 80000



my code:



#include  #include  #include  using namespace std;  /* number of employees */ const int SIZE=23;  /* creating a struct to store employees */  struct Employee {     char type;         string ssn;         string firstname;         string lastname;         string job_dept;         string job_profile;         float salary;     }employee[SIZE];  /* function that prints the details of an employee */  void printEmployee(Employee employee){ cout <><" ";="" cout=""><><" ";="" cout=""><><" ";="" cout="">< employee.lastname="">< "="" ";="" cout="">< employee.job_dept="">< "="" ";="" cout="">< employee.job_profile="">< "="" ";="" cout="">< employee.salary="">< "="" ";="" cout="">< endl;="" }="" int="" main(){="" int="" i;="" *="" opening="" the="" data="" file="" */="" ifstream="" in("employee_data.txt");="" if="" (!in){="" cerr="">< "file="" can't="" be="" opened!="" "="">< endl;="" system("pause");="" exit(1);="" }="" *="" storing="" data="" of="" employees="" in="" array="" of="" arrays="" */="" for="" (int="" i="0;" i="">< size;="" i++){="" in="">> employee[i].type >> employee[i].ssn      >>employee[i].firstname >> employee[i].lastname >> employee[i].job_dept >> employee[i].job_profile >> employee[i].salary;     }          /* printing salaried employees */     for (int i=0;i < size;i++)="" {="" if(employee[i].type="=" 's'){="" printemployee(employee[i]);="" }="" }="" *="" printing="" hourly="" basis="" employees="" */="" for="" (int="" i="0;i">< size;i++)="" {="" if(employee[i].type="=" 'h'){="" printemployee(employee[i]);="" }="" }="" *="" prompting="" user="" to="" enter="" ssn="" of="" an="" employee="" */="" string="" ssn;="" cout="">< endl="">< "enter="" ssn="" of="" employee="" to="" get="" details:="" ";="" cin="">> ssn;  /* displaying the details of the employee whoose ssn number is entered */ for (int i=0;i
Aug 30, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here