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

Your first task in developing the application for tracking contributors is to lo

ID: 3799991 • Letter: Y

Question

Your first task in developing the application for tracking contributors is to load a list of the people who are helping the cause. Design and develop a linked list, implemented as a stack, to track all of the contributors. You will read the contributor information from a file provided; it is a comma delimited (CSV) file. Your design should include the following:

Each contributor will have the following Information:

Name: String; //the name of the contributor

City: String; //the city in which the contributor lives

Country: String; //the country in which the contributor lives

Phone: String; //the phone number for the contributor

Contribution: Double; //the amount of the contribution given by the contributor to the zoo

ID: Integer; //identifier key for future needs

Contributor Functions/Methods:

Input constructor: //to accept a string for the name and additional information for each contributor (this should call the Push constructor to implement the stack)

Print constructor: //to print out the contributor data

Pop constructor

Push constructor

Deliverables:

A fully documented program to load the data implemented as a stack

A test plan to show how the program runs and can be executed

A screenshot showing that the program loaded the data, and after all data is loaded, perform a single pop of the stack

Explanation / Answer

the contributor objects are pushed onto a stack list. The list is then printed out using a print method in class List. The toString method is overridden in class Donor and used to format the ouput of each object as its printed. Method toString is called from the print method in List. Currently it is called explicitly, but will also work as an implicit call.

Once the list is populated and printed, a pop method is called to remove the object at the top of the stack (removeFromFront() in class List called from pop() in class StackInheritance). The removed object is printed out for display purposed and the list is re-printed to show the remaining objects it contains.

    Required methods:

The entire application uses 6 classes to create list objects, push them onto a stack list, and pop one of the objects back off the list. Four of the classes is designed to allow for list creation involving objects of any type, whether primitive or object. Methods in class list make it possible to design lists that are either stack or queue type, or a hybrid of the two. ListNode is used to create node objects consisting of references and data. List is used to instantiate a list and manipulate nodes within it. StackInheritance extends List and is used to specifically implement a

stack type list. EmptyListException is used to handle empty list exceptions, should they arise. Its methods are called from class list. Class Donor was written to create contributor objects for this assignment. It consists of the requested contributor information ( as private class fields ) and an associated constructor to create list objects. Donor also contains public setters and getters.

Class DonorTest is the application file. It contains the main method for the package. It also contains a method named readCSV. ReadCSV is used to; read in the csv file, parse its lines, assign parsed token values to the contributor objects (via the Donor constructor), push the constructed objects onto the stack list, print out the list, pop an object off the list and re-print it. The screenshots show two ways of using the list's print function. First, the list is printed as each object is pushed. This confirms that the list is being properly populated as each line is read from the input file. Next the print method is moved outside the while loop and a screenshot shows the results of printing the list after its fully populated. Both screenshots show the one object (contributor) being popped off the list, and the list showing the remaining contributors.

Deliverables:

A screenshot showing that the program loaded the data, and after all data is loaded, perform a single pop off the stack The Donor class defines and constructs contributor objects. It also contains an overriding toString method used by the List class when called from the application class (DonorsTest) to print out a list of donors. This class also contains get and set methods for each of the class fields. The methods are public so they may be called by other members of the package.

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