Write a menu-driven program that uses an array of queues to keep track of a group of executives as they are transferred from one department to another, get paid, or become unemployed. Executives within a department are paid based on their seniority, with the person who has been in the department the longest receiving the most money. Each person in the department receives $1000 in salary for each person in her department having less seniority than she has. Persons who are unemployed receive no compensation.
Your program should be able to process the following set of commands:
Join <person> <department> --> <person> is added to <department>
Quit <person> --> <person> is removed from his or her department
Change <person> <department> --> <person> is moved from old department to <department>
Payroll --> Each executive's salary is computed and displayed by the department in decreasing order of seniority