The president of Indiana Imports and Exports has two secretaries, Wanda and Ralph. Each of them has specific tasks to take care of: Wanda handles import related tasks, Ralph handles export tasks. Both secretaries use the same method for performing their tasks. As each task comes in, it is given to either Ralph or Wanda who puts the task on top of a "things-to-do" pile. W hen either secretary finishes a task, he or she takes the one on top of the "things-to-do" pile and starts to work on it. If there is nothing in the pile, the secretary reads a magazine for half an hour then checks the pile again. Every now and then, the boss comes in to check on the secretaries, to see what they are doing and what they still have to do.
Write a program in PL6 to simulate the daily actions of the two secretaries by using two stacks. The file, 310SECY.COMPSCI, contains records that indicate the daily events. The form of these records is
Column Contents
1 Event code "A" indicates that a task is to be added to the
pile. "B" indicates that the secretary begins the task on
top of the pile (this happens for the first task done by
the secretary .and after reading a magazine). "E" indicates
that the secretary finishes a task (another task is begun
immediately if there is one on the pile). "S" indicates that
the boss requires a status report.
2-6 Name of the secretary involved in the event.
8-37 Name of the task. Appears only on "A" events.
The format of the status report is up to you; however, it must show at least three things: (1) the name of the secretary being reported on, (2) the name of the task that is being worked on or "reading a magazine" if the secretary is not working on a task, (3) the list of tasks on the secretary's "things-to-do" pile, from top to bottom (if there is nothing on the pile, say so).
Program requirements.
1. Both stacks must be contained in the same array.
2. The number of tasks which may be on both "things-to-do" piles together is up to 25.