Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

design a program to simulate a printer queue. Printer queues maintain the print jobs (documents, images, etc.) that are sent to a printer. HP LaserJet

 design a program to simulate a printer queue. Printer queues maintain the print jobs (documents, images, etc.) that are sent to a printer.

imageimage

HP LaserJet 4V Printer Document View Document Name http://opencda.com/?p=492 Secret Plans.wps 1 document(s) in queue Status Owner Pages Size Submitted Port Printing Dan 21 1.97 MB/19.7... 11:44:35 AM 6/8/2008 192.16 Spooling Dan N/A 11:47:34 AM 6/8/2008 Example of the Print Queue GUI in Windows (You do NOT need to create a graphical interface) To represent each Print Job, design a PrintJob object that simply contains an ID number and the number of pages to printed. Every time you create a PrintJob object, make sure its ID is one greater than the previously created PrintJob. The Driver Class/Main In a main function, you'll set up your queue structure for storing PrintJob objects. The program will indefinitely ask the user to enter one of the following three commands: add - Entering this command will cause the program to prompt the user for the number of pages to print. The program will then generate a PrintJob object and store it in the queue. print - Entering this command will "print" the print job at the front of the queue. The program will pop the next print job and display the print job's ID and number of pages that were printed. exit - End/exit the program. Other Notes . If the user enters an invalid command, print an error message and ask them to try again. If the print queue is empty, print a message stating that fact. You may not use queue/queue-like structures built into your chosen programming language.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

To simulate a printer queue we can create a simple program in Python This program will use a queue data structure to manage print jobs Here we will im... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Java, Enhanced Early Objects

Authors: Cay S Horstmann

7th Edition

1119499097, 9781119499091

More Books

Students also viewed these Programming questions

Question

Explain why the terms manager and leader are not interchangeable.

Answered: 1 week ago

Question

Under what circumstances would an UnknownHostException be thrown?

Answered: 1 week ago