Question: In c++ program: Write functions to read in and print an Employee struct and Write an additional function that passes in an array of Employees
In c++ program: Write functions to read in and print an Employee struct and Write an additional function that passes in an array of Employees and returns the index to a found id.
Note: I tried this on my own and manage to finish step1. I'm current stuck in Step 2. Please post your version of how to solve this program.


Here is the code for existing Employee.h
#include
const unsigned int NUM_EMPL=5;
struct Employee { string name; int id; double salary; };
void printEmployee(const Employee& c); Employee readEmployee(); //----Add findEmployee prototype for Step 2----
Here is the code for existing main.cpp
#include
int main() { Employee employees[NUM_EMPL]; int tempId; int index;
cout
for (int i=0; i //----Add code below for Step2---- //prompt the user for an id //call the findEmployee function //if found, display the name of the employee that goes with the id }
Step by Step Solution
There are 3 Steps involved in it
Sure Lets proceed with step 2 Youll want to define the findEmployee function and incorporate it into ... View full answer
Get step-by-step solutions from verified subject matter experts
