Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coding language is Python using the Wing 101 IDE. Also, if you need more info, please comment and specify what info you need, because just

image text in transcribed

Coding language is Python using the Wing 101 IDE. Also, if you need more info, please comment and specify what info you need, because just saying 'need more info' doesn't help me if I don't know what info you would need.

Simulate the following task with a dynamic (linked list) queue (class to be coded by you; can be based on code from class, but acknowledge your source). Your queue class, must at least contain: __init__0, enqueue(), dequeue(), front(), and isEmpty. Your output should agree with that generated by the eSubmit solution. 5 of the 40 marks are allocated for Queue class. Write a simulator to manage print jobs. A print job will be processed in the order of submission (you must make sure this is the only order possible for your program), and there are multiple printers (numbered 0 through (k-1)). All the printers print at the same rate. Each print job has a number of pages, and will tie up a printer for that number of cycles. A cycle is the time it takes to print one page. Write a program that will use your class that can reading from standard input: a. create k (create k printers, must occur prior to any other command) b. add ni nz n3 ... n. (add m print jobs, in that order, with pages given) c. cycle n (apply that number of cycles). d status (Display the current status of the printers and jobs left) e. quit (terminates the simulation and prints a summary of the session) Call your program printersimulation (). This how we will invoke it in eSubmit. Your solution will also need to implement a printer class that accepts print jobs (removed from the queue). You will also need to monitor (in some fashion) the state of the printer (free, busy, pages to print?). The printer can only handle one print job at a time. In this assignment, if any printers are free and there is a print job available, it should choose the printer with the smallest numerical name. Since marks will be allocated by eSubmit testing this is important. Make sure your program agrees with the test program. So for example, if there are 2 printers and 3 jobs, job 1 (5 pages), job 2 (7 pages) and job 3(13 pages), after 6 cycles (printed pages), one printer (2) would have job 2 on it with 1 page left and the other (1) would have job 3 on it with 12 pages left. You will use a linked queue that will be used for all the print jobs (the printers get new jobs from the queue when they are not processing a job). 2 . You must use classes as appropriate. Make sure all data structures and methods/functions are clearly documented. Output should only be generated for the status and quit commands. Our test input will be correct, no error checking is needed. Remember to save the project into your drive (for your own use and for possible demo) and eSubmit to hand it in. Be sure to comment any assumptions you may have made that are not indicated on the specification Note 1: Only one queue is needed. It should be for the print queue. Printers are distinct pieces in the system and do not need a queue, nor need to be stored in a queue. Note 2: Think about how what happens in a single cycle. Once you understand how a cycle operates, then your solution will become more clear. . . Simulate the following task with a dynamic (linked list) queue (class to be coded by you; can be based on code from class, but acknowledge your source). Your queue class, must at least contain: __init__0, enqueue(), dequeue(), front(), and isEmpty. Your output should agree with that generated by the eSubmit solution. 5 of the 40 marks are allocated for Queue class. Write a simulator to manage print jobs. A print job will be processed in the order of submission (you must make sure this is the only order possible for your program), and there are multiple printers (numbered 0 through (k-1)). All the printers print at the same rate. Each print job has a number of pages, and will tie up a printer for that number of cycles. A cycle is the time it takes to print one page. Write a program that will use your class that can reading from standard input: a. create k (create k printers, must occur prior to any other command) b. add ni nz n3 ... n. (add m print jobs, in that order, with pages given) c. cycle n (apply that number of cycles). d status (Display the current status of the printers and jobs left) e. quit (terminates the simulation and prints a summary of the session) Call your program printersimulation (). This how we will invoke it in eSubmit. Your solution will also need to implement a printer class that accepts print jobs (removed from the queue). You will also need to monitor (in some fashion) the state of the printer (free, busy, pages to print?). The printer can only handle one print job at a time. In this assignment, if any printers are free and there is a print job available, it should choose the printer with the smallest numerical name. Since marks will be allocated by eSubmit testing this is important. Make sure your program agrees with the test program. So for example, if there are 2 printers and 3 jobs, job 1 (5 pages), job 2 (7 pages) and job 3(13 pages), after 6 cycles (printed pages), one printer (2) would have job 2 on it with 1 page left and the other (1) would have job 3 on it with 12 pages left. You will use a linked queue that will be used for all the print jobs (the printers get new jobs from the queue when they are not processing a job). 2 . You must use classes as appropriate. Make sure all data structures and methods/functions are clearly documented. Output should only be generated for the status and quit commands. Our test input will be correct, no error checking is needed. Remember to save the project into your drive (for your own use and for possible demo) and eSubmit to hand it in. Be sure to comment any assumptions you may have made that are not indicated on the specification Note 1: Only one queue is needed. It should be for the print queue. Printers are distinct pieces in the system and do not need a queue, nor need to be stored in a queue. Note 2: Think about how what happens in a single cycle. Once you understand how a cycle operates, then your solution will become more clear

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions