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

Restrictions: you cannot use any methods from the Java Array(s) class to copy an

ID: 3752455 • Letter: R

Question

Restrictions: you cannot use any methods from the Java Array(s) class to copy an array, check for equality, or otherwise manipulate an array You also may not call the Java Syatemartasepx method You must write the Java code to perform these functions. In completing the list method, you will need to use import): the Java File class. You may use any of the methods that are available in the Java File class in developing your algorithm. In particular, you should need to use the: the java Scanner class " You may also use any of the class that you created in any previous assignment in this class. Specifically, if needed, you can use your: o ListBa or o Singlylinkedist (from textbook Code Fragments) e classes if needed. Create a NetBeans project named Lab104 and ensure it is saved to a location like desktop or your flash drive. In the project you will do the following: Create a Recursion Class that will implement the following recursive algorithms: * Implement a recursive algorithm to compute the n Harmonic number defined R-1 *Implement Isabel's technique for summing the values in an array of n integers as described in problem C-5.24 on page 223 of the textbook. The values to be summed by Isabel's technique should be stored in an ASCIl text file. You can create this file using a text editor like Notepad. o

Explanation / Answer


hi please follow below instructions to meet our requirement

package com.commonprograms;
import java.util.Scanner;
interface BagInterface<T>
{
public void remove();
public int getCurrentSize();
public boolean isEmpty();
public boolean add(T newEntry);
public T remove1();
public boolean remove(T anEntry);
public void clear();
public int getFrequencyOf(T anEntry);
public boolean contains(T anEntry);
}
public class LinkedBag<T> implements BagInterface
{
private LinkedListNode<T> first = null;
public void add(LinkedListNode<T> node)
{
node.setNext(first);
first = node;
}
public void remove()
{
if(first.getNext()!=null)
first = first.getNext();
else first = null;
}
private void Display(LinkedListNode<T> node)
{
System.out.println("Node is " + node.getValue());
if(node.getNext()!=null)
Display(node.getNext());
}
public void print()
{
Display(first);
}
public static void main(String[] args)
{
LinkedBag<String> list = new LinkedBag<String>();
String PlayerNames;
Scanner sc=new Scanner(System.in);
int size;
System.out.println("Please enter howmany players");
size=sc.nextInt();
for(int i=0;i<size;i++)
{
System.out.println("Enter The Player Name: ");
PlayerNames=sc.next();
list.add(new LinkedListNode<String>(PlayerNames));
}
/**list.add(new LinkedListNode<String>("venkanna"));
list.add(new LinkedListNode<String>("Shireesha"));
list.add(new LinkedListNode<String>("Ravi"));
list.add(new LinkedListNode<String>("Mounika"));*/
System.out.println("The ELements in the List is:");
list.print();
System.out.println("");
list.remove();
System.out.println("After removing the head from the List is:");
list.print();
sc.close();
}
public int getCurrentSize() {
return 0;
}
public boolean isEmpty()
{
return false;
}
public boolean add(Object newEntry)
{
return false;
}
public Object remove1()
{
return null;
}
public boolean remove(Object anEntry)
{
return false;
}
public void clear() {
}
public int getFrequencyOf(Object anEntry)
{
return 0;
}
public boolean contains(Object anEntry) {
// TODO Auto-generated method stub
return false;
}
}
class LinkedListNode<T>
{
private T value;
private LinkedListNode<T> next;
public LinkedListNode(T value)
{
this.value = value;
}
public void setNext(LinkedListNode<T> next)
{
this.next = next;
}
public LinkedListNode<T> getNext()
{
return next;
}
public T getValue()
{
return value;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote