Answered Essay: Due: Tuesday, Sep. 15,2015 11:59 PM for 100 points Early Bonus: Monday, Sep. 14h,201511:59 PM

Due: Tuesday, Sep. 15,2015 11:59 PM for 100 points Early Bonus: Monday, Sep. 14h,201511:59 PM for a 10 point bonus Submission Instructions: Submissions should be made on Blackboard. Upload your java files only No email submission is allowed. 1. Complete IntArrayList.java file. Grading Rubric Style o (20 points) Code readability (proper indentation, appropriate variable names, etc) 0 (20 points) Documentation (programmer names, homework # and date; program and functions have brief comments describing their purpose, inline comments used as necessary) Correctness o (10 points) insert (no partial credit will be given o (10 points) append (no partial credit will be given) o (10 points) remove (no partial credit will be given o (10 points) moveToPos (no partial credit will be given) o (10 points) getValue (no partial credit will be given) o (10 points) printAll (no partial credit will be given) o(-40 points) Non-Compilable Code
Basically I have to fill in the party’s that need filling from this code below in order to make it work how it says on the rubric
public class IntArrayList {
private int maxSize;
private int listSize;
private int curr;
private int [] listArray;
public IntArrayList(int size) {
maxSize = size;
listSize = 0;
curr = 0;
listArray = new int[maxSize];
}
public IntArrayList( ) {
maxSize = 100;
listSize = 0;
curr = 0;
listArray = new int[maxSize];
}
public void clear() {
listSize = 0;
curr = 0;
}
// Insert an element at the current location.
// item: The element to be inserted
public void insert(int num) {
/*
*
* FILL THIS PART
*
*/
}
// Append an element at the end of the list.
// item: The element to be appended.
public void append(int num) {
/*
*
* FILL THIS PART
*
*/
}
// Remove and return the current element.
// Return: the element that was removed.
public int remove() {
/*
*
* FILL THIS PART
*
*/
}
// Return: The current element.
public int getValue() {
/*
*
* FILL THIS PART
*
*/
}
public void printAll() {
/*
*
* FILL THIS PART
*
*/
}
// Set current position.
// pos: The position to make current.
public void moveToPos(int pos) {
/*
*
* FILL THIS PART
*
*/
}
// Set curr to 0 (front)
public void moveToStart() {
curr = 0;
}
// Set currr to listSize (end)
public void moveToEnd() {
curr = listSize;
}
// move curr to the prev position
public void prev() {
if (curr > 0)
curr–;
}
// move curr to the next position
public void next() {
if (curr < listSize)
curr++;
}
// return the length of List
public int length() {
return listSize;
}
// return curr position
public int currPos() {
return curr;
}
public static void main(String[] args) {
// Testing IntArrayList
IntArrayList lst = new IntArrayList(10);
lst.printAll();
lst.insert(1);
lst.insert(2);
lst.insert(3);
lst.insert(4);
lst.insert(5);
lst.insert(6);
lst.printAll();
lst.moveToEnd();
lst.insert(10);
lst.printAll();
lst.moveToStart();
lst.insert(100);
lst.printAll();
lst.moveToPos(4);
System.out.println(“array[4] = ” + lst.getValue());
lst.clear();
lst.printAll();
lst.insert(12);
lst.append(0);
lst.append(1);
lst.append(2);
lst.insert(22);
lst.moveToPos(1);
lst.remove();
lst.printAll();
}
}

Due: Tuesday, Sep. 15,2015 11:59 PM for 100 points Early Bonus: Monday, Sep. 14h,201511:59 PM for a 10 point bonus Submission Instructions: Submissions should be made on Blackboard. Upload your java files only No email submission is allowed. 1. Complete IntArrayList.java file. Grading Rubric Style o (20 points) Code readability (proper indentation, appropriate variable names, etc) 0 (20 points) Documentation (programmer names, homework # and date; program and functions have brief comments describing their purpose, inline comments used as necessary) Correctness o (10 points) insert (no partial credit will be given o (10 points) append (no partial credit will be given) o (10 points) remove (no partial credit will be given o (10 points) moveToPos (no partial credit will be given) o (10 points) getValue (no partial credit will be given) o (10 points) printAll (no partial credit will be given) o(-40 points) Non-Compilable Code

Expert Answer

 

Here is your completed java program:

IntArrayList Java:

public class IntArrayList {

private int maxSize;

private int listSize;

private int curr;

private int [] listArray;

public IntArrayList(int size) {

maxSize = size;

listSize = 0;

curr = 0;

listArray = new int[maxSize];

}

public IntArrayList( ) {

maxSize = 100;

listSize = 0;

curr = 0;

listArray = new int[maxSize];

}

public void clear() {

listSize = 0;

curr = 0;

}

// Insert an element at the current location.

// item: The element to be inserted

public void insert(int num) {

listArray[curr]=num;

if(curr==listSize)

listSize++;

curr++;

}

// Append an element at the end of the list.

// item: The element to be appended.

public void append(int num) {

listArray[listSize]=num;

listSize++;

}

// Remove and return the current element.

// Return: the element that was removed.

public int remove() {

int n;

n=listArray[curr];

for(int i=curr;i<listSize;i++)

{

if(i!=listSize)

{

listArray[i]=listArray[i+1];

}

}

listSize-=1;

/*int[] temp=new int[listArray.length];

for(int i=0;i<listArray.length-1;)

{

if(i==curr)

continue;

else

{

temp[i]=listArray[i];

i++;

}

}

listArray=temp;*/

return n;

}

// Return: The current element.

public int getValue() {

return listArray[curr];

}

public void printAll() {

for(int i=0;i<listSize;i++)

System.out.println(listArray[i]+” “);

}

// Set current position.

// pos: The position to make current.

public void moveToPos(int pos) {

curr=pos-1;

}

// Set curr to 0 (front)

public void moveToStart() {

curr = 0;

}

// Set currr to listSize (end)

public void moveToEnd() {

curr = listSize;

}

// move curr to the prev position

public void prev() {

if (curr > 0)

curr–;

}

// move curr to the next position

public void next() {

if (curr < listSize)

curr++;

}

// return the length of List

public int length() {

return listSize;

}

// return curr position

public int currPos() {

return curr;

}

public static void main(String[] args) {

 

// Testing IntArrayList

IntArrayList lst = new IntArrayList(10);

lst.printAll();

lst.insert(1);

lst.insert(2);

lst.insert(3);

lst.insert(4);

lst.insert(5);

lst.insert(6);

lst.printAll();

 

lst.moveToEnd();

lst.insert(10);

lst.printAll();

lst.moveToStart();

lst.insert(100);

lst.printAll();

 

lst.moveToPos(4);

System.out.println(“array[4] = ” + lst.getValue());

 

lst.clear();

lst.printAll();

lst.insert(12);

lst.append(0);

lst.append(1);

lst.append(2);

lst.insert(22);

lst.moveToPos(1);

lst.remove();

lst.printAll();

}

}

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.