-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhoneFundraiser.java
More file actions
34 lines (30 loc) · 1 KB
/
Copy pathPhoneFundraiser.java
File metadata and controls
34 lines (30 loc) · 1 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
public class PhoneFundraiser extends Fundraiser
{
/**
* Takes in Message and a candidate.
* Calls super Constructor---> Fundraiser
*/
public PhoneFundraiser(String inLoc, Candidate inCandidate)
{
super(inLoc,inCandidate);
}
/**
* Returns Information about PhoneFundraiser
*/
public String toString()
{
return getCandidate().getName() + "'s phone 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.
* It will then decrease Candidates Money Modifier by 5%
*/
public int raiseMoney()
{
int total = super.raiseMoney();
getCandidate().setMoneyMod(getCandidate().getMoneyMod() - .05);
return total;
}
}