Home /
Expert Answers /
Computer Science /
in-c-can-i-get-the-h-and-cpp-files-with-a-main-cpp-file-the-assignment-imagine-that-the-stude-pa400

**In C++ can I get the .h and .cpp files with a main.cpp file
The Assignment**

Imagine that the student services center (SSC), which houses the registrar, cashier, and financial aid office, has approached you with the following issues. At certain times during the day, students arrive in large numbers, each needing to visit one or more offices. If there are not enough windows open at each, the average student wait times are too long, and they receive many complaints. On the other hand, if they open too many windows, their staff will be idle for most of the time, and they will be wasting money. They want you to program a simulation that will allow them to calculate metrics on student wait times and window idle times given a specific traffic flow of students through the SSC.

**The Simulation**

You will model the above problem to meet the SSC’s requirements. As students arrive in the SSC, they will go to one of the offices they need to visit, and wait in a queue. When a window becomes available they will exit the queue and remain at the service window for however long they need. They will then move onto the next office they need to visit, and repeat the process until they have completed all their tasks. Your first job will be to build a generic doubly-linked list data structure, from scratch, supporting the usual operations, which we have largely completed in class. You will then use this linked list to build a generic queue data structure, supporting the usual operations. You may not use a queue or linked list from the C++ STL libraries. You will then use your queue implementation to implement the simulation.

Input will be in the form of a command line argument that specifies the location of a text file. The text file will define at what times students arrive, and what offices they will visit and in what order. It will have the following format. The first line will be the number of windows open at the registrar. The second line will be the number of windows open at the cashier. The third line will be the number of windows open at the financial aid office. The next line will be the time (or clock tick) at which the next students arrive. The next line will be the number of students that arrive at that time. The following lines will be the amount of time each student needs at the registrar, cashier, and financial aid office, respectively, as well as the order they visit them. This is followed by the next clock tick, number of students, etc. The last line in the file will consist of the string “END.” For example, and input of:

2

3

1

1

2

5 1 2 R C F

10 5 1 F R C

3

1

4 2 6 R C F

END

Means that 2 windows will be open at the registrar, 3 at the cashier, and 1 at the financial aid office. At time 1, 2 students arrive. The first will need 5 minutes at the registrar, 1 minute at the cashier, and 2 minutes at financial aid, in that order. The second student will need 10 minutes at financial aid, 5 minutes at the registrar, and 1 minute at the cashier, in that order. Then, at time 3, 1 student arrives and needs 4 minutes at the registrar, 2 minutes at the cashier, and 6 minutes at financial aid. No more students arrive after this.

When students arrive at the same time and visit the same office first, assume that the student listed first in the text file is also the first to get into line. If 2 students finish at different offices at the same time and head to the same office next, assume that they enter the line based on alphabetical order of the office they are coming from (eg. cashier always beats financial aid which always beats registrar).

The simulation will start at time 1, and run until all student requests have been addressed, meaning the queue at each office is empty and no more students are going to arrive.

At the end of the simulation, your program will display (on standard out) the following (labeled) metrics:

1. The mean student wait time for each office.

2. The longest student wait time for each office.

3. The number of students waiting over 10 minutes total across all offices.

4. The mean window idle time for each office

5. The longest window idle time for each office

6. Number of windows idle for over 5 minutes across all offices.

**The Design**

Your simulation will consist of the following classes (bolded classes are required):

**DblList** - the doubly linked list template class

**ListQueue** - the list-based queue template class

**ServiceCenter** - models the service center

**Office** - models an individual office in the service center

**Window** - models a single window in one of the offices

**Customer** - models a student coming into the service center

Any other classes you want to create for the simulation

You should also provide a main.cpp to run the program, which takes the input specification file as a command line argument.

**Rules of Engagement**

You may **NOT** use any non-primitive data structures other than what we have implemented in class. You may not use any data structures from the C++ STL. Of course, to do the file processing you may use any of the standard C++ IO classes.