diff options
| author | mokha <mokha@cisco.com> | 2019-05-05 19:36:09 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-05-05 19:36:09 -0600 |
| commit | 3c2be35d16d7482442911f5b06b68512f86e15b5 (patch) | |
| tree | 636edf7d09f2cc0b2f006c058071ce5b3d9adda6 /src/main/java/ca/mokhan/assignment1/Candidate.java | |
| parent | 46e409f3ca33ec3c7546d0589301c2a4f967c10a (diff) | |
butcher default directory structure to make instructor happy
Diffstat (limited to 'src/main/java/ca/mokhan/assignment1/Candidate.java')
| -rw-r--r-- | src/main/java/ca/mokhan/assignment1/Candidate.java | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/main/java/ca/mokhan/assignment1/Candidate.java b/src/main/java/ca/mokhan/assignment1/Candidate.java deleted file mode 100644 index 7df9535..0000000 --- a/src/main/java/ca/mokhan/assignment1/Candidate.java +++ /dev/null @@ -1,75 +0,0 @@ -package ca.mokhan.assignment1; - -import java.util.ArrayList; - -public class Candidate extends AddressBook { - private double grade = 0.0; - private Communication communication; - private boolean isInnovative; - private double regulatoryCapability; - - public Candidate( - String firstName, - String lastName, - double grade, - String communication, - boolean isInnovative, - double regulatoryCapability) { - super(firstName, "", lastName); - this.grade = grade; - this.setCommunication(communication); - this.isInnovative = isInnovative; - this.regulatoryCapability = regulatoryCapability; - } - - public boolean isInnovative() { - return this.isInnovative; - } - - public double getGrade() { - return this.grade; - } - - public double getRegulation() { - return this.regulatoryCapability; - } - - public String getCommunication() { - return this.communication.toString(); - } - - public void setCommunication(String communication) { - this.communication = Communication.findBy(communication); - } - - public void setGrade(double grade) { - this.grade = grade; - } - - public void setInnovation(boolean innovation) { - this.isInnovative = innovation; - } - - public void setRegulation(double regulatoryCapability) { - this.regulatoryCapability = regulatoryCapability; - } - - public boolean isEligible() { - if (this.grade >= 85.0) { - return this.communication.isAtLeast(Communication.Average) || this.isInnovative(); - } else { - return (this.regulatoryCapability >= 0.5 - && this.communication.isAtLeast(Communication.Average)); - } - } - - public static ArrayList<Candidate> getEligibleCandidates(Candidate[] candidates) { - ArrayList<Candidate> eligible = new ArrayList<Candidate>(); - - for (Candidate candidate : candidates) { - if (candidate.isEligible()) eligible.add(candidate); - } - - return eligible; - } -} |
