November 25th, 2012, 06:00 AM
can any one please help me doing my assignment please please please please
Write a program that takes care of a printer queue. Your program will simulate and evaluate the printing. The arrival pattern of print jobs will be represented in a file as the arrival times (in printing time intervals (you can think fo these as some number of seconds or a minute)) of each print job and its number of pages. The file will be specified in a command line parameter to your program. Your program will take no input other than the test file name as the command line parameter. You will simply open the file, process the print jobs, print out the results, and exit. You may assume that the arrival times in the file are in order. It takes one time interval to print each page. You should process the jobs in the file and then print out the total number of jobs processed, the total number of pages printed, and the average waiting time per job. Waiting time is the number of intervals from arrival time to beginning of printing. The job at the head of the queue is currently being printed and is not dequeued until printing completion. Use a linked list to implement your queue. There are many List templates available (for example, the Standard Template Library offers a list template). However, for this assignment, when you use a linked list, it will be your own code so that you can practice your programming and learn the concepts thoroughly.
NOTE - Be aware of the precision of the average waiting time per job. You must print the average waiting time with a precision of 4 significant digits. HINT - use iomanip
A sample file is shown below (a 0 specifies the end of the processing):
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.