[phpBB Debug] PHP Warning: in file [ROOT]/ext/lmdi/autolinks/event/listener.php on line 237: Undefined array key 52
[phpBB Debug] PHP Warning: in file [ROOT]/ext/lmdi/autolinks/event/listener.php on line 237: Trying to access array offset on value of type null
Answer Happy • In python create a printer class: - use methods found in template below Expected output should allow the user to type nu
Page 1 of 1

In python create a printer class: - use methods found in template below Expected output should allow the user to type nu

Posted: Sat Feb 19, 2022 3:22 pm
by answerhappygod
In python create a printer class:
- use methods found in template below
In Python Create A Printer Class Use Methods Found In Template Below Expected Output Should Allow The User To Type Nu 1
In Python Create A Printer Class Use Methods Found In Template Below Expected Output Should Allow The User To Type Nu 1 (76.26 KiB) Viewed 68 times
Expected output should allow the user to
type number of printers to create by typing create then a
number
for example: create 5
Add print jobs with various numbers of pages by typing add and
listing the number of pages per job
for example: add 5 7 4 9 10 34 5 20
and choose the number of pages they want to print per
cycle
for example: cycle 6
final implementation should look like this:
printer_simulation()
In Python Create A Printer Class Use Methods Found In Template Below Expected Output Should Allow The User To Type Nu 2
In Python Create A Printer Class Use Methods Found In Template Below Expected Output Should Allow The User To Type Nu 2 (98.24 KiB) Viewed 68 times
class printer: def __init__(self, name): self.name = name def __str__(self): pass def is_ready(self): # returns boolean after inspectin # of pages to print pass def print(self): # subtracts 1 from the number of pages left to print # adds 1 to the total number of pages so far pass def accept(self, pages): # updates the number of pages to print 'pages' pass def print_simulation(): # create a queue object that will hold all print jobs # create a list that will hold all printers pass
create 5 add 5 7 4 9 10 34 5 8 4 20 status Printer: Pages to print: 5 Total pages printed: 0 Printer: 1 pages to print: 7 Total pages printed: 0 Printer: 2 Pages to print: 4 Total pages printed: 0 Printer: 3 Pages to print: 9 Total pages printed: 0 Printer: 4 Pages to print: 10 Total pages printed: 0 Jobs in queue: 5 [34, 5, 8, 4, 20] cycle 6 status Printer: @ Pages to print: 4 Total pages printed: 6 Printer: 1 Pages to print: 1 Total pages printed: 6 Printer: 2 Pages to print: 32 Total pages printed: 6 Printer: 3 Pages to print: 3 Total pages printed: 6 Printer: 4 Pages to print: 4 Total pages printed: 6 Jobs in queue: 3 [8, 4, 20] [