Java Programming Implement a virtual print queue

Java Programming Implement a virtual print queue

Implement a virtual print queue. A single print queue is servicing a single printer. Print requests appear periodically and print jobs can take more than one cycle on the printer to complete printing. Attached is a file which has four types of input records:

q,3,10 is a q type record which indicates that a print job, # 3, shall be placed at the rear of the queue and print for 10 cycles when it is removed from the front of the queue and prints.

p,4,5 is a p type record which indicates that a prioritized print job, # 4, shall be placed at the front of the queue and execute for 5 cycles when it is removed from the front of the queue and prints.

s,5 is an s type record which indicates that 5 cycles should be executed before the next input record is examined.

h is an h type record which indicates to halt execution of the simulation and print out the executing print jop number, the number of cycles left to execute and the remaining print queue numbers and cycles in order of execution from last to first.

A print job will decrement the number of remaining cycles at the start of a new cycle. When a job finishes (the number of remaining cycles reaches 0), a new job should be loaded on the same cycle. You must implement the queue insert and remove methods as described in the text. You must also implement a priority insert method which inserts a prioritized print job at the beginning of the queue. You must implement a stack with the push and pop methods to print the remaining queue numbers and cycles for the halt.

View Answers









Related Tutorials/Questions & Answers:
Java Programming Implement a virtual print queue
Java Programming Implement a virtual print queue  Implement a virtual print queue. A single print queue is servicing a single printer. Print... records: q,3,10 is a q type record which indicates that a print job, # 3, shall
java: implement a class queue
java: implement a class queue  Implement a class Queue which supports the following operations: boolean isEmpty() Returns true if the queue...-empty queue without deleting it. int pop() Removes the item at the front of a non
Advertisements
Implement the Queue in Java
Implement the Queue in Java       In this section, you will learn how to implement the queue. A queue... program implements a queue. It takes all elements as input by user. These values
How to implement link in Web app lead to report with print and save features
How to implement link in Web app lead to report with print and save features   Hi friends, I developed a web application based on Java MVC architecture and Struts framework with Tomcat appserv, and I need to implement link lead
Java Virtual Machine
Java Virtual Machine  What is Java Virtual Machine? Are JVM different for each OS? Thanks   Hello, JVM or Java Virtual Machine is run... more at Java Virtual Machine Technology. Thanks
java virtual machine
java virtual machine  please give some detail about JVM
queue in java
queue in java  how to performe all queue operation?   Please visit the following link: Queue Example in Java
The implement keyword
The implement keyword       In java programming language, the keyword implement specifies... because java does not allow multiple inheritance, by it may implement more
Virtual Fuction invokation in java
is virtual method in java?Please explain...Virtual Fuction invokation in java  Please help me. If i have create a Employee class,which is the super class of Manager. And I create an object
Virtual Fuction invokation in java
is virtual method in java?Please explain...Virtual Fuction invokation in java  Please help me. If i have create a Employee class,which is the super class of Manager. And I create an object
Java Virtual Machine Technology
Java Virtual Machine Technology Java development kit termed as  JDK have more than one implementation of the JVM. Java HotSpot Client VM also termed.... This is the Virtual machine implementation comes with JDK.It is basically designed to cut
Non-virtual Methods in Java - java tutorials
hierarchy. In Java programming language all the methods are virtual, i.e....: #000000; } Non Virtual Methods in Java Lets see the concept of virtual... by inheriting the class. In C++ programming you can make a function virtual
Java code to implement MULTIPATH INHERITANCE
Java code to implement MULTIPATH INHERITANCE  HI, I am new to java programming. I want to implement multipath inheritance in one java program... Please write code for above example to implement both
Java Virtual Machine
Java Virtual Machine       In this section, you will learn about the java virtual machine (JVM) and how to work? Java Virtual Machine (JVM) Java Virtual Machine is a set of computer
java programming
in question Implement the program described above using the Java programming language...java programming   Companies and people often buy and sell stocks... programming method you want to accomplish this task. Both your stack and queue
java programming
in question Implement the program described above using the Java programming language...java programming   Companies and people often buy and sell stocks... programming method you want to accomplish this task. Both your stack and queue
how i can print the elements before a spicific value in array queue?
how i can print the elements before a spicific value in array queue?  how i can printall elements befor the spicific value and print this value also   Hi Friend, Try this: <html> <script> var arr=new Array
java programming:generating series
java programming:generating series  WAP to print series: | + || + ||| + |||| + .......... n terms
How to implement FTP using java
want to implement FTP using Java to transfer files and exchange files between FTP client and FTP server. Could anyone help me for How to implement FTP using java... is the best tutorials and example of Apache FTP Library: FTP Programming in Java
Java Virtual Machine
Java Virtual Machine The Java Virtual Machine is a software package that comes with the JRE or JDK. It is a virtual machine which is responsible for running... Virtual Machine provides the execution environment for the Java programs
virtual function
virtual function  Explain virtual functions in Java
Queue in java
Queue in java In this section we will discuss about queue in java. Queue is a interface in java.util package of java. It holds the collection of data... which is added first into the queue will be removed first from the queue
Java Virtual Machine Free Download
Java Virtual Machine Free Download       The Java Virtual Machine is required to run your java program in your computer. The Java Virtual Machine software is freely downloadable from
Java collection Queue Example
Java collection Queue Example  How can we use Queue in java... class MainDemo { public void queueExample() { Queue queue = new LinkedList(); queue.add("Java"); queue.add("DotNet
Java Queue Example
Java Queue Example  how to use queue in java ?   import... void queueExample() { Queue queue = new LinkedList(); queue.add("Java"); queue.add("DotNet"); queue.offer("PHP
Queue - Java Beginners
Queue  i'm working with queue on java. since im beginners im asking for additional example programs on queue using java to enhance my knowledge. thanks so much for the help! God bless
Java Virtual Machine Free Download
Java Virtual Machine Free Download       Java Virtual Machine Free Download The Java Virtual Machine is required to run your java program in your computer. The Java Virtual
Java Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
groupby implement in java
groupby implement in java  **import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Arrays
groupby implement in java
groupby implement in java  **import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.Arrays
virtual function
virtual function  can we have virtual functions in java
Java programming problem - Java Beginners
Java programming problem  could anyone help me to solve this problem... Implement a superclass Person. Make two classes, Student and Instructor... or Instructor) and the properties -Print the details of all Instructors and Student
Java code to implement MULTIPATH INHERITANCE
Java code to implement MULTIPATH INHERITANCE  Hi, I am new to java .so please write code for this inheritance example... Student | ----------- | | Test Sports
What is an efficient way to implement a singleton pattern in Java?
What is an efficient way to implement a singleton pattern in Java?  What is an efficient way to implement a singleton pattern in Java
How to print this in java?
How to print pattern in Java?  How to print a particular pattern in Java...;  How to print this in java
stack and queue - Java Beginners
stack and queue  write two different program in java 1.) stack 2.) queue   Hi Friend, Please visit the following links: http://www.roseindia.net/java/example/java/util/StackImplement.shtml http
Print Form - Java Beginners
Print Form  Hello Sir I have Created Admission Form when user fills data and submit that data to access database,then when i Click on PRINT Button I want to get Print of that forms Contents,How I can Do it with JAVA SWING,plz
programming error - Java Beginners
programming error  how can we statically implement linked list????????  Hi Friend, Please visit the following links: http://www.roseindia.net/java/jdk6/LinkedListExample.shtml http://www.roseindia.net/java
JavaScript array queue
;  In the JavaScript array we can implement the Queue by using the push() and shift() methods. It is a very simple way to implement queues. Queue is a data structure of type FIFO( First In First Out) so we can implement Queue
How to remove virtual keypad from apps java
How to remove virtual keypad from apps java  I have an galaxy smart s6830 touch Chinese Mobile (240x320) (myriad java platform) (esmertec jbed) and I need to remove keypad from apps . I have put the following into the jar file
How to remove virtual keypad from apps java
How to remove virtual keypad from apps java  I have an galaxy smart s6830 touch Chinese Mobile (240x320) (myriad java platform) (esmertec jbed) and I need to remove keypad from apps . I have put the following into the jar file
How to remove virtual keypad from apps java
How to remove virtual keypad from apps java  I have an galaxy smart s6830 touch Chinese Mobile (240x320) (myriad java platform) (esmertec jbed) and I need to remove keypad from apps . I have put the following into the jar file
Java Print Dialog
Java Print Dialog  Using java.awt.print.PrinterJob and javax.print.attribute.PrintRequestAttributeSet. I call .printDialog(ps) and the standard print dialog is displayed with options preset to my chosen attributes. Now I can
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
java programming
java programming  WAP to accept 10 strings from the user and find out the string with maximum length and print the same.   Here is a code that accepts 10 strings from the string and stored into array and then find
Simplest way to print an array in Java
Simplest way to print an array in Java  Simplest way to print an array in Java
Java Queue
Java Queue       A queue... more about java queue go to the link:  ADS_TO_REPLACE_2 http.... It is independent of the order used, while the head of the queue is that element
programming - Java Beginners
programming  how to implement web client in java
programming - Java Beginners
programming for java beginners  How to start programming for java beginners
print rectangle pattern in java
print rectangle pattern in java  * * * * * * * how to generate this pattern in java??   Hi friend try this code may this will helpful for you public class PrintRectangle { public static void main

Ads