Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

NOTE: The completed code must pass in the following compiler. Please make absolu

ID: 3576275 • Letter: N

Question

NOTE: The completed code must pass in the following compiler. Please make absolutely sure it does before posting: http://codecheck.it/codecheck/files?repo=bj4cc&problem=ch09/c09_exp_9_103

PLEASE also make sure of the following:
-Post this as text, not as an image.
-Avoid making alterations to the original code unless necessary.
-Post the passing output- from the this compiler specifically- as evidence this code was accepted and passed.

~

Some objects can be doubled, for example a bank account. The result would be a bank account with twice the balance. Some objects can't be doubled. For example, there is no double of a dime coin—no twenty cent coin exists.

The Doublable interface specifies a method for making an object that is double of the current one. It should only be implemented by classes for which doubling makes sense.

Your job is to modify the Word class of chapter 6 (which is reproduced below, with the bugs fixed) so that it implements the Doublable interface. Doubling a word should repeat its text. For example,

should produce a Word object with text "JavaJava".

Complete the following code:

The following classes are used to check your work:

Explanation / Answer

import java.util.Scanner;

/* category Node */
class Node
builder */
public Node()
  
/* creator */
public Node(int d, Node n, Node p)
  
/* perform to line link to next node */
public void setLinkNext(Node n)
  
/* perform to line link to previous node */
public void setLinkPrev(Node p)
  
/* Funtion to urge link to next node */
public Node getLinkNext()
come next;
}
/* perform to urge link to previous node */
public Node getLinkPrev()
come prev;
}
/* perform to line knowledge to node */
public void setData(int d)
  
/* perform to urge knowledge from node */
public int getData()
come data;
}
}

/* category linkedList */
class linkedList
finish ;
public int size;

/* creator */
public linkedList()
begin = null;
finish = null;
size = 0;
}
/* perform to envision if list is empty */
public mathematician isEmpty()
come begin == null;
}
/* perform to urge size of list */
public int getSize()
come size;
}
/* perform to insert component at begining */
public void insertAtStart(int val)
{
Node nptr = new Node(val, null, null);
if(start == null)
begin = nptr;
finish = start;
}
else
{
start.setLinkPrev(nptr);
nptr.setLinkNext(start);
begin = nptr;
}
size++;
}
/* perform to insert component at finish */
public void insertAtEnd(int val)
{
Node nptr = new Node(val, null, null);
if(start == null)
begin = nptr;
finish = start;
}
else
{
nptr.setLinkPrev(end);
end.setLinkNext(nptr);
finish = nptr;
}
size++;
}
/* perform to insert component at position */
public void insertAtPos(int val , int pos)
  
Node ptr = begin;
for (int i = 2; i <= size; i++)
  
ptr = ptr.getLinkNext();
}
size++ ;
}
/* perform to delete node at position */
public void deleteAtPos(int pos)
{
if (pos == 1)
{
if (size == 1)
begin = null;
finish = null;
size = 0;
return;
}
begin = begin.getLinkNext();
start.setLinkPrev(null);
size--;
return ;
}
if (pos == size)
  
Node ptr = start.getLinkNext();
for (int i = 2; i <= size; i++)
  
ptr = ptr.getLinkNext();
}
}
/* perform to show standing of list */
public void display()
  
Node ptr = start;
System.out.print(start.getData()+ " <-> ");
ptr = begin.getLinkNext();
while (ptr.getLinkNext() != null)
making object of linkedList */
linkedList list = new linkedList();
System.out.println("Doubly joined List Test ");
char ch;
/* Perform list operations */
do
{
System.out.println(" Doubly joined List Operations ");
System.out.println("1. insert at begining");
System.out.println("2. insert at end");
System.out.println("3. insert at position");
System.out.println("4. delete at position");
System.out.println("5. check empty");
System.out.println("6. get size");

int selection = scan.nextInt();
switch (choice)