Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA: A circular buffer, circular queue, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were

JAVA:

A circular buffer, circular queue, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure lends itself easily to buffering data streams. To read more about it [Click Here] In this assignment you will implement a simulation of a printer buffer that accepts printing jobs. The printer has limited buffer size of maximum 10 jobs. If the printer received any job while its buffer is full, it will reject the job. Printing a job will remove it from the queue. The priority is FIFO, i.e. based on arrival time, first job added to the buffer is the first job to be removed.

The run of your program should like the following screen shots:

image text in transcribed

image text in transcribed

image text in transcribed

Implementation:

Class PrinterJob: This class represents the printing job. Has two data members:

Job ID: This is an auto-increment field. First object is assigned 1, second is assigned 2, etc. To implement this you will need to use a static data member that serves as an object counter and increment each time a new instance is created.

Job Text: This represents the name of the file

Class CircularBuffer: In this class you will have the implementation to a circular queue similar to the one we discussed in class. The only difference is that this circular buffer has a limited capacity. You dont have to expand it if its full. You will also need to add a method isFull() that returns true of the queue reached maximum capacity.

PrinterTest:This is the class that contains the main function with the menu that appears to the user.

Thank you in advance.

[1] To add a new printer job 21 To print next job [3] To view current buffer content [4] To clear buffer [5] To Exit Enter your choice: Enter text Documentl Figure1: Adding a new printer job. User enters the name of the file [1] To add a new printer job 21 To print next job [3] To view current buffer content [4] To clear buffer [5] To Exit Enter your choice: Enter text Documentl Figure1: Adding a new printer job. User enters the name of the file

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

DESCRIBE the five-step training process.

Answered: 1 week ago

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago