-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocialFundraiser.java
More file actions
36 lines (31 loc) · 1.09 KB
/
Copy pathSocialFundraiser.java
File metadata and controls
36 lines (31 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
public class SocialFundraiser extends Fundraiser
{
/**
* Takes in Message and a candidate.
* Utilizes Super constructor----> Fundraiser
* Throws too low in polls exception if Candidates total money is less than 1% of
*/
public SocialFundraiser(String inLoc, Candidate inCandidate)
{
super(inLoc,inCandidate);
}
/**
* Returns String about SocialFundraiser
*/
public String toString()
{
return getCandidate().getName() + "'s social fundraiser takes place in: " + getLocation() + " and has " + getDonors() + " donors attending.\n";
}
/**
* Calls the super constructor---> Fundraiser
* It will raise money for the Candidate depending on how many random Donors he has and how much
* the total random amount of money each of them carry, totaled up.
* Then it will increase Candidates Money Modifer by 10%.
*/
public int raiseMoney()
{
int total = super.raiseMoney();
getCandidate().setMoneyMod(getCandidate().getMoneyMod() + .1);
return total;
}
}