Question
Java coding. Create a class called Printer and a class called Job that will simulate a computer printer. The printer should store a queue of
Java coding.
Create a class called Printer and a class called Job that will simulate a computer printer. The printer should store a queue of Job objects until they are printed. Each Job should consist of a title and the number of pages the job contains. The printer should also store the number of jobs it can print per minute. The class should include methods to add jobs and print jobs. The method that prints a job should return the amount of time it took to print the job. Create a driver program that processes an input file that contains one of two directions on each line.
The directions are: 1. Add Title # Pages Add the specified Job to the printer
2. Print n Print the specified number of jobs
Each instruction is on a separate line and each token of each instruction is separated by a single tab character. Each time a job is printed, determine how long it would take to print the job and keep track of how much time has been spent printing all together. When the whole file has been processed, print a summary that includes the total number of jobs and pages printed and the total amount of time spent printing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started