You are on page 1of 2

Printing Queue

A printing queue is a queue that contains information about the documents that are going to be printed in a specified printer. Each document in the printing queue has the following info: Document name: the name of the file to be printed Owner: the user that send the file to the printer Pages: the number of pages of the document to be printed Size: the size in kilobytes of the file

For example, if the user secretaria sent a file to the printer, the corresponding record in the printing queue could be as follows: hoja de vida.doc secretaria 10 877k Write a program to simulate a printing queue. The program should read a text file that contains information of a queue of printing jobs and simulates the entire printing process. The example below shows the format of the input file. 100 10 16:30:00 tarea.pdf / Usuario1 / 20 / 974k Test.java / juan / 4 / 127k hoja de vida.doc / secretaria / 10 / 877k The first line is the number of available paper sheets for printing. The second line is the time spent by the printer (in seconds) when printing a single sheet. The third line is the starting time of the printing process. The format is hours:minutes:seconds. The next lines in the input file contain information of the printing jobs, one job per line. Thus, the first job in the example above is file tarea.pdf which has 20 pages and 974 kilobytes, and was sent by the user Usuario1. The output of the program will be the total number of paper sheets that were used (34 in the example below) and the list of documents that were printed, one per line. Besides, the time at which each document was printed. For example, if the input file were the one above, the output will be as follows: 34 tarea.pdf 16:33:20 Test.java 16:34:00 hoja de vida.doc 16:35:40

In case the available paper sheets were not enough for printing all the jobs, the output list must contain only Jobs that can be printed entirely.

Reglas
Implementar y usar el TAD Queue. Su programa se debe poder invocar desde la lnea de comandos (consola de Windows o Shell de Linux) con un parmetro que es el nombre del archivo de texto que tiene los datos de entrada. Puede suponer que el archivo tiene el formato correcto Esta tarea puede realizarse individualmente o en grupos de 2 personas Los nombres de los autores y sus cdigos deben aparecer en la primera lnea de cada archivo fuente Entregables: deben entregar a travs de blackboard (use el Buzn de transferencia digital) dos archivos: o printing.jar que contenga todos los archivos .java y .class de su programa o diseo.pdf que contenga el diagrama de clases de su programa. No es necesario que incluya los mtodos de cada clase en su diagrama (Se recomienda usar el programa violet) Deadline: sbado 11 de mayo a las 11:59:59 p.m. Cualquier entrega posterior ser ignorada

You might also like