Question: JAVA PROGRAMMING LANGUAGE PREFERRED. Thank you! Target Topics: Stacks & Queues Assignment Description: You are asked to write a program that simulates processing documents in

JAVA PROGRAMMING LANGUAGE PREFERRED. Thank you!JAVA PROGRAMMING LANGUAGE PREFERRED. Thank you! Target Topics: Stacks & Queues Assignment

Target Topics: Stacks & Queues Assignment Description: You are asked to write a program that simulates processing documents in some imaginary legal office. This process involves a secretary, and two clerks. These clerks process the documents that are labeled based on their ID's. One officer will process their work based on the priority, while the other goes with the exact order the documents were received. The secretary will receive documents and stores them in an array in the exact order of their arrival. The documents will be distributed to the clerks based on the ID's, as well as the pattern each clerk is supposed to process them. You need to pick a data structure for the secretary, as well as each clerk based on the description given here. The document will be represented as a class described below: class Document: Attributes: int ID; int priority; // 1 or 2 representing officers // 1-size of documents based on user input // randomly generated, lower the number, // higher the priority // This will be simply the number of the // object that is instantiated, think of it // as an array index: 0-[size-1]. The first // document will be 0, next will be 1, etc. int timestamp; Methods: All the set and get methods. The following is the list of the tasks needed in the main method: Prompt the user for the size of the documents, not exceeding100. We will need to instantiate that many objects of type Document by randomly picking an ID of 1 or 2, and assign a random priority value in the range 1 through the size inputted by the user. We will not worry about the duplicates. Clerk with ID of 1, will be given their list based on the priority of the documents. Pick the proper data structure for this clerk and insert their respective documents in their pile. We assume clerk with the ID of 2 processes their documents based on their order of arrival. Your job here is to pick the right data structure for them, and insert the document that is addressed to them in its proper position. When you are done with this process, the clerks have their data structures populated. As the output, you are required to display the following lists: 1. The list of documents received by the secretary in the exact order they are created. With the first one on top row of the output. 2. Clerk 1's followed by Clerk 2's list of documents with the first document they will access to appear on top row of the respective section of the output. The following is an example of this program's output: Please enter the number of documents: 50 Documents original list: TimeStamp ID Priority 0 1 23 1 2 8 2 2 41 3 1 1 //other data 48 2 35 49 1 50 Clerk #1: TimeStamp 3 ID 1 Priority 1 //other data 23 0 1 // other data 49 1 50 Clerk #2 : TimeStamp 1 ID 2 2 eon Priority 8 41 2 //other data 48 2 35 These are important points about using these data structures: You must attempt and maintain the integrity of the data structure defined in the Java class you downloaded. This means that you should not use operations other than what is defined for these data structures, since that would translate into customizing and going around the purpose and the design of such data structures. Notice that the original list of documents would be the data structure that you use for the secretary. Points to address in a report about this assignment: Point 1: What data structures did you choose for each clerk and why? Point 2: Did your attempt in displaying the list of documents based on the requirements of the assignment end up "emptying" your lists? How would you have prevented this, whilst keeping the integrity of the data structures? Point 3: List pros and cons in using arrays in the context of this simulation. Target Topics: Stacks & Queues Assignment Description: You are asked to write a program that simulates processing documents in some imaginary legal office. This process involves a secretary, and two clerks. These clerks process the documents that are labeled based on their ID's. One officer will process their work based on the priority, while the other goes with the exact order the documents were received. The secretary will receive documents and stores them in an array in the exact order of their arrival. The documents will be distributed to the clerks based on the ID's, as well as the pattern each clerk is supposed to process them. You need to pick a data structure for the secretary, as well as each clerk based on the description given here. The document will be represented as a class described below: class Document: Attributes: int ID; int priority; // 1 or 2 representing officers // 1-size of documents based on user input // randomly generated, lower the number, // higher the priority // This will be simply the number of the // object that is instantiated, think of it // as an array index: 0-[size-1]. The first // document will be 0, next will be 1, etc. int timestamp; Methods: All the set and get methods. The following is the list of the tasks needed in the main method: Prompt the user for the size of the documents, not exceeding100. We will need to instantiate that many objects of type Document by randomly picking an ID of 1 or 2, and assign a random priority value in the range 1 through the size inputted by the user. We will not worry about the duplicates. Clerk with ID of 1, will be given their list based on the priority of the documents. Pick the proper data structure for this clerk and insert their respective documents in their pile. We assume clerk with the ID of 2 processes their documents based on their order of arrival. Your job here is to pick the right data structure for them, and insert the document that is addressed to them in its proper position. When you are done with this process, the clerks have their data structures populated. As the output, you are required to display the following lists: 1. The list of documents received by the secretary in the exact order they are created. With the first one on top row of the output. 2. Clerk 1's followed by Clerk 2's list of documents with the first document they will access to appear on top row of the respective section of the output. The following is an example of this program's output: Please enter the number of documents: 50 Documents original list: TimeStamp ID Priority 0 1 23 1 2 8 2 2 41 3 1 1 //other data 48 2 35 49 1 50 Clerk #1: TimeStamp 3 ID 1 Priority 1 //other data 23 0 1 // other data 49 1 50 Clerk #2 : TimeStamp 1 ID 2 2 eon Priority 8 41 2 //other data 48 2 35 These are important points about using these data structures: You must attempt and maintain the integrity of the data structure defined in the Java class you downloaded. This means that you should not use operations other than what is defined for these data structures, since that would translate into customizing and going around the purpose and the design of such data structures. Notice that the original list of documents would be the data structure that you use for the secretary. Points to address in a report about this assignment: Point 1: What data structures did you choose for each clerk and why? Point 2: Did your attempt in displaying the list of documents based on the requirements of the assignment end up "emptying" your lists? How would you have prevented this, whilst keeping the integrity of the data structures? Point 3: List pros and cons in using arrays in the context of this simulation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!