Based on the new requirement from your boss to be able to search for a contributor’s name, you decide it will be a good idea to have the data sorted. You will read the contributor information from a...

1 answer below »

Based on the new requirement from your boss to be able to search for a contributor’s name, you decide it will be a good idea to have the data sorted. You will read the contributor information from a file provided; it is a common delimited (CSV) file. As each record is read, create a sorted Linked list of the contributors using the Insertion sort method. At this point, you no longer need to maintain the stack. 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 Add constructor to implement the sorted list)

  • Print constructor: //to print out the contributor data

  • Print All constructor: //to print the entire list of contributor names

  • Add constructor: //to traverse the linked list and find the proper location for adding the instance



Deliverables:



  • A Fully Documented Program to load the data creating a sorted linked list.

  • A Test Plan to show how the program runs and can be executed.

  • A screen shot showing that the program loaded the data. After all data is loaded perform a Print All showing the sorted list.



Please submit your assignment.

Answered Same DayDec 01, 2021

Answer To: Based on the new requirement from your boss to be able to search for a contributor’s name, you...

Aditi answered on Dec 05 2021
134 Votes
Solution/Contributor.java
Solution/Contributor.java
 
public class Contributor {

    private String contributor;
    private Strin
g city;
    private String country;
    private String phoneNumber;
    private double contribution;
    private int ID;

    private Contributor next;
    public Contributor(String contributor, String city, String country, String phoneNumber, double contribution, int ID, Contributor next) {
        this.contributor = contributor;
        this.city = city;
        this.country = country;
        this.phoneNumber = phoneNumber;
        this.contribution = contribution;
        this.ID = ID;
        this.next = next;
    }

    public Contributor(String contributor, String city, String country, String phoneNumber, double contribution, int ID) {
        this.contributor = contributor;
        this.city = city;
        this.country = country;
        this.phoneNumber = phoneNumber;
        this.contribution = contribution;
        this.ID = ID;
        this.next = null;
    }

    public Contributor(Contributor con){
        this.contributor = con.contributor;
        this.city = con.city;
        this.country = con.country;
        this.phoneNumber = con.phoneNumber;
        this.contribution = con.contribution;
        this.ID = con.ID;
        this.next = con.next;
    }
    public String getCity() {
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here