Hi! Thanks for helping me. I need to write a program (in C++) that reads the file Employee.dat as input and then outputs to 4 different files which are Managers.dat, Marketing.dat, Developers.dat, and Testers.dat. Each of the output files contains the name of the employees of its category.
The fle Employee.dat contains following data:
Sue Leon 4
Robert Wise 3
Sam Woo 1
Nathan White 3
Suzan Head 2
Henry Williams 4
Christine Mint 1
Kim Leeds 4
Elton Sue 3
Ken Latch 2
I tried to write the program but I don't know what to put in "SWITCH" loop. Here is what i have so far.
With writing the files you have a choice between 1 output stream which you open and close to switch between files, or 4 output streams (1 for each file).
Having 4 streeams will be quicker and simpler to code, but take more resources (probably not an issue here).
In the switch statement simply have a case for each department and output the name to the appropriate stream in each case.
Remeber to include a break at the end of each case otherwise the code will run on to the next case.