During the second half of any Spring
semester at IUP, the Admissions office receives many requests from students
to take courses at other colleges and universities during the summer and
have those course credits transferred to IUP. To make such a transfer,
students must fill out a Transfer Pre-Approval Form that must be signed
by the Admissions Office Coordinator, the Chair of the department in which
the student is majoring, and the Dean of the college to which the student
belongs.
This project involves a simulation of the processing of these student requests. Each of you plays the part of the one of the students; each of you makes one transfer request. You submit your request by placing it on top of the other such forms to be processed in the Admissions Coordinator's In-Box. Every so often, the Coordinator takes the top form from the In-Box, approves it, and places the form on top of other such forms in the Coordinator's Out-Box. Several times during the day, an assistant in the Admissions office goes to the Coordinator's Out-Box, carefully picks up the entire contents (however many forms are there), takes them to the department Chair's office, and places them in the Chair's In-Box (so that they are in the same order as they were in the Coordinator's Out-Box). Every so often, the Chair takes the top form from the In-Box, approves it and places the form on top of other such forms in the Chair's Out-Box. Several times during the day, an assistant in the Chair's office goes to the Chair's Out-Box, carefully picks up the entire contents (however many forms are there), takes them to the Dean's office, flips the group of forms over (the assistant regards this as the fair thing to do), and places them in the Dean's In-Box (so they are in the reverse order that they were in the Chair's Out-Box). Every so often, the Dean takes the top form from the In-Box and approves it. At that point, the requested transfer is completely approved.
A chronologically ordered script of the transfer approval process has been created to represent one day's action during the Spring semester. This script is in the file transfers.txt in the world-read folder for your section on the P: drive. Each line of the file represents a single action by one person as described above. Below is a description of how to interpret the lines of the file:
Student request:
time R last-name
first-name course-number college-number
Each element is separated from the next
by a space. The time is in the form of the 24-hour clock, e.g., 2:38
pm is 1438. The R indicates this is a student request. The
names are those of the student (each name is one word); the course number
is an identifier (an int) associated with an IUP course; and the college
number is the identifier (an int) of the college which the student will
attend during the summer.
Admission Coordinator's approval:
time A
This indicates that the Coordinator approves
a request, moving it from the In-Box to the Out-Box. Assume the approval
takes no time to complete.
Chair's approval
time C
This indicates that the Chair approves
a request, moving it from the In-Box to the Out-Box. Assume the approval
takes no time to complete.
Dean's approval
time D
This indicates that the Dean approves
a request, moving it out of the In-Box. Assume the approval takes
no time to complete. When the Dean gives final approval, your program
should display the name of the person making the request, the
time the person made the request, the time the final approval
came, and the number of the course being approved.
Transport from Admissions to Department
Chair
time T A C
This indicates the Admissions' assistant
takes the contents of the Coordinator's Out-Box and puts it into the Chair's
In-Box. Assume this action takes no time to complete.
Transfer from Department Chair to the Dean
time T C D
This indicates the Chair's assistant takes
the contents of the Chair's Out-Box, reverses it, and puts it into the
Dean's In-Box. Assume this action takes no time to complete.
Status
time S
This is not really an action. It
is a request that the program display the number of requests in
each of the three In-Boxes and two Out-Boxes at the moment. This
display should include labels indicating which box is which.
Your program is to use stacks to simulate the In-Boxes and Out-Boxes. It must process the events in the script to run the simulation; this processing involves performing the actions on the stacks as described above. At the end of the simulation, your program should display the contents of each In-Box and Out-Box. The display should show each request from top to bottom in each box; it should include the student's name and the time the request was made.
Notes:
In the script file, there are a few events
with the same times. Don't be concerned about this; it is the result
of only using times to the nearest minute. If two or three events
have the same time, they are to be performed in the order the events are
listed in the script.
Sometimes when the Admissions Coordinator, the Chair, or the Dean attempts to process a request (by taking it from the In-Box, approving it and placing it in the Out_Box), there will be no requests in the In-Box. This is not an error situation; the Coordiantor, Chair, or Dean just does nothing at that time.
Occasionally, when an assistant attempts to empty the Out-Box for one office and take the contents to the In-Box of another office, there will be no requests in the Out-Box. This is not an error situation; the assistant just does nothing at that time.
Sometimes when an assistant is putting
a collection of requests into an In-Box, there are still some requests
left in that In-Box. This is not an error; the requests being added
are simply placed on top of the requests that were leftover.
Hand in a printout of your program
and a printout of the output generated by running the program on
the script in transfers.txt Also,
copy your source file(s) to the hand-in folder for your section
on the P: drive.
End of the output you should get; wording and spacing need not be an exact match.
Status at 1605
AdmitIn AdmitOut ChairIn ChairOut
DeanIn
4
0 3
1 7
Lindsay
Bowser in at 1446 out at 1610 course 14328
Jeremy
Jurick in at 1437 out at 1618 course 13343
Chad
Green in at 1428 out at 1626 course 12830
Richard Cummings in
at 1331 out at 1634 course 12551
Daniel Sterrett
in at 1322 out at 1642 course 12998
Status at 1705
AdmitIn AdmitOut ChairIn ChairOut
DeanIn
2
2 2
2 2
Admissions In
Bernard McCurdy in at 1320
Ekapop Pairam in at 1244
Admissions Out
Eric Pennington in at 1322
Christopher Heidt in at 1422
Chair In
Jeffrey Hopkins in at 1522
Marshall Leitem in at 1434
Chair Out
Selina Aggudey in at 1427
Shafquat Husain in at 1340
Dean In
Zachary Torba in at 1318
David Pazzaglia in at 1305