Question: Code commenting in java public class Queue { private int front = queueSize - 1, back = queueSize - 1, length = 0; private int[]

Code commenting in java public class Queue { private int front = queueSize - 1, back = queueSize - 1, length = 0; private int[] queue = new int[queueSize]; private boolean ERROR_FREE = true; private final static int queueSize = 5; public boolean isEmpty() { return length == 0; } public boolean isFull() { return (length == queueSize); } public boolean isErrorFree() { return ERROR_FREE; } public void Empty() { front = queueSize - 1; back = queueSize - 1; length = 0; ERROR_FREE = true; } public int dequeue() { ERROR_FREE = !(isEmpty()) & (ERROR_FREE); if (ERROR_FREE) { length--; if (front == queueSize - 1) { front = 0; } else { front++; } return queue[front]; } else { return 0; } } public void enqueue(int value) { ERROR_FREE = !(isFull()) & ERROR_FREE; if (ERROR_FREE) { length++; if (back == queueSize - 1) { back = 0; } else { back++; } queue[back] = value; } } }

Task 2.1 Following MRs Commenting Standard, add comments to the variables and explain how the data type queue has been realised. Material to show when getting ticked off: your comments in an editor.

Task 2.2 Following MRs Commenting Standard, add comments within all methods of the class Queue. Material to show when getting ticked off: your comments in an editor.

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!