Question: IN JAVA complete where it says TODO : AND THE DONOR CLASS IS IN THIS LINK ( https://s2.postimg.org/nmuej2ze1/donor_class.png) import java.util.ArrayList; public class Campaign {

IN JAVA complete where it says " TODO" :

AND THE DONOR CLASS IS IN THIS LINK ( https://s2.postimg.org/nmuej2ze1/donor_class.png)

import java.util.ArrayList;

public class Campaign {

private String candidateName;

private ArrayList donors;

public Campaign(String name)

{

//TODO Initialize all of the instance data

}

public String getCandidateName()

{

//TODO Complete the accessor

return null; // stub

}

public String getDonors()

{

String result = candidateName + " ";

result += donors.toString();

return result;

}

public double getAllDonations()

{

double sum = 0.0;

for (int i=0; i

{

Donor d = donors.get(i);

sum += d.getTotalDonations();

}

return sum;

}

public void addDonor(String name)

{

// TODO Check that there is not a donor by this name already

// TODO If we get here this donor does not exist--add them in

}

public double getDonation(String donor)

{

//TODO Complete this method

return 0.0; // stub

}

public String getDonationList(String donor)

{

for (int i=0; i

{

Donor d = donors.get(i);

if (d.getName().equals(donor))

{

return d.toString();

}

}

return "No donor with that name was found";

}

public void addDonation(String donorName, double donation)

{

// TODO Complete this method

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!