Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago