-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhoneFundraiser.java
More file actions
42 lines (39 loc) · 1.42 KB
/
PhoneFundraiser.java
File metadata and controls
42 lines (39 loc) · 1.42 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
37
38
39
40
41
42
/**
* The PhoneFundraiser class is used to simulate a Automated Phone Calls Fundraiser
* The PhoneFundraiser class subclass of Fundraiser
* The PhoneFundraiser has a location, and candidate.
* @author Fuad Mohamoud
*/
public class PhoneFundraiser extends Fundraiser
{
/**
*toString method used to output specific information about the current PhoneFundraiser
* @return output indicating a PhoneFundraiser has been ran and the name of candidate running the PhoneFundraiser
*/
public String toString()
{
String output="This is a Phone Fundraiser for " + getCandidate().getName();
return output;
}
/**
*Default Constructor to build and empty PhoneFundraiser
* Default Constructor is required in order for program to run, however it not actually used.
*/
public PhoneFundraiser()
{
}
/**
*
* Full Parameter Constructor to build a PhoneFundraiser using the inputted parameter values provided
* @param inLoc will be used as the location of the PhoneFundraiser
* @param inCandidate will used as the candidate run the PhoneFundraiser
*/
public PhoneFundraiser(String inLoc, Candidate inCandidate)
{
setLocation(inLoc);
setCandidate(inCandidate);
donors = rand.nextInt(201);
raiseMoney();
inCandidate.setMoneyMod(inCandidate.getMoneyMod()+.05);
}
}