I have a project that I am having trouble with! Any help would be greatly appreciated! It is a five part project, meaning at the end all 5 must be done and included in the project. Each part just builds on the last one.
Part 1:
you will write the code that will read a data file in and store the data in some sort of data
structure (an array) so that your program will have the data available when you
try to process it. The format of the data file will be some undetermined number of lines of data, where
each line contains: (I have a text file to be read in this program called "test.txt" )
last name, first name, arrival time, time to process the person’s transaction (in minutes)
So a sample data file would look like this:
Toth, David, 07:59, 5
Davies, Stephen, 09:54, 17
Finlayson, Ian, 15:23, 10
You do not know how many lines will be in the file. Your code must figure out how to make sure to read
each line. The arrival time will be between 06:00 and 18:00 (6 AM to 6 PM). You can assume that a
person will be able to be processed before 23:59 so nobody is thrown out of the store when it closes.
You must also write code to display when each person would leave if there was no line when they
arrived. So for the example line given above, I would leave at 08:04, Stephen would leave at 10:11, and
Ian would leave at 15:33.
Your output should look like this
08:04 - Toth, David left
10:11 - Davies, Stephen left
15:33 - Finlayson, Ian left
Part 2:
You need to assume that there is one checkout lane for the customers. If there is one checkout
lane, each customer starts being processed as soon as he/she arrives if there is nobody else in the
checkout lane. If there is somebody in the checkout lane, the customer is processed once the customer
ahead of them has been processed. Keep track of the time the person arrived, how long each person sat
in line before his/her transaction started. Keep track of the total time each person was there (time to
wait in line before being processed + time to be processed) and also when the person left. When each
person has been processed, print out the information for them that you tracked plus the average time
each customer sat in line and the average total time for each person.
Part 3:
Modify your program to read in a maximum number of checkout lines from
the command line when the program is run. Then run the simulation assuming there is 1 checkout line
and print out the statistics like in Part 2. Do it again for 2 checkout lines. Do it again for 3, 4, 5, …, n
where n is the maximum number of checkout lines, printing out the statistics each time. In this scenario,
everybody gets kept in a queue until a checkout person is freed up. Then, when a checkout lane is open,
the first person waiting in the queue goes to that checkout line.
Part 4:
Modify your program to read in a maximum number of checkout lines from
the command line when the program is run. Then run the simulation assuming there is 1 checkout line
and print out the statistics like in Part 2. Do it again for 2 checkout lines. Do it again for 3, 4, 5, …, n
where n is the maximum number of checkout lines, printing out the statistics each time. In this scenario,
everybody gets kept in a queue until a checkout person is freed up. Then, when a checkout lane is open,
the first person waiting in the queue goes to that checkout line.
Part 5:
Modify your program to read in a maximum number of checkout lines from
the command line when the program is run. Then run the simulation assuming there is 1 checkout line
and print out the statistics like in Part 2. Do it again for 2 checkout lines. Do it again for 3, 4, 5, …, n
where n is the maximum number of checkout lines, printing out the statistics each time. In this scenario,
everybody gets kept in a queue until a checkout person is freed up. Then, when a checkout lane is open,
the first person waiting in the queue goes to that checkout line.
Thanks for all your help. Please use lots of documentation