Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to dynamically allocate a space for the Structure Employee as it is read in to the data type Employee. Then use the Bubble
I need to dynamically allocate a space for the Structure Employee as it is read in to the data type Employee.
Then use the Bubble Sort method to sort and print by social security.
This is the current error I keep getting.
TILPP 2IN12. PP using namespace std; 600 void BubbleSort (int all, int); void printArray (int arr[], int); 1 struct Employee string role; string first; string last; int salary: string social Security: char employee_code; string department; main () { int i=0; ifstream dataIn; const int SIZE=1000; //read the file into the array// dataIn.open("employee.txt"); N N N N N mm mm mm mmm 01 ONWT if (dataIn. fail()) cout>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(); //Display employees// for (int j=0; j 0) O W N int k = 0; for(int i=0; iStep 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