design a program to simulate a printer queue. Printer queues maintain the print jobs (documents, images, etc.)
Fantastic news! We've Found the answer you've been seeking!
Question:
design a program to simulate a printer queue. Printer queues maintain the print jobs (documents, images, etc.) that are sent to a printer.
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
EPS, Debt - to - Equity, Breakeven point LexMart maintains a debt - to - equity ratio of 1 . 0 regardless of whether the firm experiences expansion or contraction. At the present time, LexMart has $...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Developments in Technology Light is incident from air on the end face of a multimode optical fibre at angle of incidence as shown below. n n 1 2 The refractive indices of the core and cladding are...
-
Starting on January 1, 2024, you put $125 every month into an account with an APR of 4.10%. Your last payment is on December 1, 2032. On January 1 of that year, the balance in the account, rounded to...
-
Identify the management levels at which charismatic, transformational, transactional, symbolic, and servant leadership styles are most appropriate.
-
A 4.0-inch cube of concrete (E = 3.0 ( 106 psi, v = 0.1) is compressed in biaxial stress by means of a framework that is loaded as shown in the figure. Assuming that each load equals 20 k, determine...
-
The financial statements for Harridges Ltd are given below for the two years ended 30 June 2014 and 2015. Harridges Limited operates a store in the centre of a small town. Dividends were paid on...
-
Plexon Tire and Rubber Company claims that its Delton III tires have an average life of at least 50,000 miles. You take a random sample of 50 Delton III tires to test Plexons claim. The average life...
-
8.6 Water A friend is tested to see whether he can tell bottled water from tap water. There are 30 trials (half with bottled water and half with tap water), and he gets 18 right. a. Pick the correct...
-
Compute the total pressure loss for each run of the duct system shown. The ducts are round cross section and all fittings are shown. Assuming that a fan is to be placed in the location labeled...
-
I. Define Public Relations in this Context: In the given scenario, what does the term "Public Relations" mean to you? How would you articulate the role of PR in managing the fallout of a...
-
For the network below with a source voltage 100 VL 0 determine currents and voltages of the three components and present them as vectors on two separate diagrams. (one for the currents and one for...
-
BINGO! The game of bingo involves drawing labeled balls from a bin at random (without replacement). There are 75 balls, 15 for each of the letters B, I, N, G, and O. Round your answers to three...
-
Develop a clear vision and mission: - Define a compelling vision for the company's future and communicate it to all stakeholders. - Establish a mission statement that emphasizes customer value,...
-
1. Define the role of CRM in your own words. 2. What are the key differences between todays CRM and the early generation of CRMs? 3. How does CRM impact the companys bottom line or performance? 4....
-
This week's safari is a little different. Read carefully. Find examples of the three (3) different specific types of (SMART) objectives noted in the Text. 1. Industry - apply the SMART criteria 2....
-
Explain the operation of the dividends received deduction.
-
The April 17, 2001, issue of the Wall Street Journal includes an article by James Bandler and Mark Maremont entitled "How Xerox's Plan to Reduce Taxes While Boosting Earnings Backfired." Instructions...
-
Ann Osborne recently graduated from college with a degree in landscape architecture. Her father runs a tree, shrub, and perennial-flower uursery, and her brother has a business delivering lopsoil,...
-
Net income is $132,000. During the year,counts payable increased $10,000, inventory decreased $6,000, and accounts receivable in- creased $12,000. Under the indirect method, net cash provided by...
Study smarter with the SolutionInn App