Recursive method that computes the summation of the


1) General Description

In this assignment you will create a new class called "XLinkedList". This class defines an inner (private) class "Node"as the container for the "T obj" data. The main idea is to recode the normal methods of a linked list to recursive ones.

2) Data and Methods of XLinkedList:

1) Data: class Node, Node head & int size.

2) Methods:

a) Default constructor: sets all data members to initial values.

b) Boolean search(T obj): a recursive method that searches the linkedlist for a passed obj and returns a true or a false if the objwas/not found.

c) double sum(): a recursive method that computes the summation of the linkedlist.

d) void clear(): a recursive method that clears the entire linkedlist. Do not use the short code: "head = null;".

e) void printLeft():a recursive method that prints all objs in the linkedlist left to right.

f) void printRight():a recursive method that prints all objs in the linkedlist right to left.

3) Add a new interface "Measurable" with these methods:

a) public double measure();

4) Create a "Tool" class that implements "Measurable" interface.

The "Tool" class models a physical tool such as: hammer, screw driver, chisel, brush, etc. Tool class should define at least the following:

a) Data members: name, id, price, purchaseDate and location (as a vector of three int entries: aisle, row, column)

b) Methods: default constructor, rand, print, toString and list. These methods are explained as follows:
- default constructor: sets all data members to values of your choice but need to be justified.
- rand: randomly generates an instance of Tool by setting all data members to random values. (more details/demo in class).
- print: displays all data members of a Tool object in one line
- toString: returns a string containing exactly the same info displayed by print().
- list: creates and returns a "ArrayList" of Tool objects.

5) Add a Driver/Demo/Test class to test ALL methods of XLinkedList.

6) Fill XLinkedList with at least 16 objs.

7) Test your project and screen-capture your sample testing to be sent along with the project.

I need a good explanation for each part of the assignment.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Recursive method that computes the summation of the
Reference No:- TGS01551649

Expected delivery within 24 Hours