diff options
| author | mokha <mokha@cisco.com> | 2019-05-05 14:45:48 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-05-05 14:45:48 -0600 |
| commit | cd228261e56d83f0471759a1eea444c2d46faead (patch) | |
| tree | 38708cb258ed1e515e17f31cbfba9a12fe71d510 | |
| parent | 7875a0e2f6ed5281ca3a4a7ba38ec27a253fb90b (diff) | |
set up test data for problem 8.
3 files changed, 60 insertions, 1 deletions
diff --git a/assignments/assignment1/README.md b/assignments/assignment1/README.md index a2e06d2..9c609f8 100644 --- a/assignments/assignment1/README.md +++ b/assignments/assignment1/README.md @@ -212,7 +212,7 @@ The criteria for selection are as follows: * III. Innovation as one of the two values – "brilliant" and "average" (store as a Boolean; brilliant = true and average = false). The fifteen candidates have the following innovative abilities: brilliant, average, average, average, brilliant, brilliant, average, brilliant, average, brilliant, average, brilliant, brilliant, average, average. * IV. Ability to regulate one’s own skill as a probability value between 0 and 1.0 – 1.0 implies excellent regulatory capabilities and 0.0 implies no skills to regulate (store as a double). -The fifteen candidates have the following regulatory abilities: 0.5, 1.0, 0.8, 0.0, 1.0, 0.7, 0.8, 0,9, 0.5, 0.6, 0.3, 0.2, 0.5, 0.3, 0.8. + The fifteen candidates have the following regulatory abilities: 0.5, 1.0, 0.8, 0.0, 1.0, 0.7, 0.8, 0.9, 0.5, 0.6, 0.3, 0.2, 0.5, 0.3, 0.8. Store these values for the fifteen candidates in an extended AddressBook class. diff --git a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/Candidate.java b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/Candidate.java new file mode 100644 index 0000000..4d36bd4 --- /dev/null +++ b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/Candidate.java @@ -0,0 +1,22 @@ +package ca.mokhan.assignment1; + +public class Candidate extends AddressBook { + private double grade = 0.0; + private String communication; + private boolean innovation; + private double regulatoryCapability; + + public Candidate( + String firstName, + String lastName, + double grade, + String communication, + boolean innovation, + double regulatoryCapability) { + super(firstName, "", lastName); + this.grade = grade; + this.communication = communication; + this.innovation = innovation; + this.regulatoryCapability = regulatoryCapability; + } +} diff --git a/assignments/assignment1/src/test/java/ca/mokhan/assignment1/CandidateTest.java b/assignments/assignment1/src/test/java/ca/mokhan/assignment1/CandidateTest.java new file mode 100644 index 0000000..eba2c88 --- /dev/null +++ b/assignments/assignment1/src/test/java/ca/mokhan/assignment1/CandidateTest.java @@ -0,0 +1,37 @@ +package ca.mokhan.assignment1; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +public class CandidateTest extends TestCase { + private Candidate[] runners = { + new Candidate("Elena", "Brandon", 82.30, "poor", true, 0.5), + new Candidate("Thomas", "Molson", 85.10, "poor", false, 1.0), + new Candidate("Hamilton", "Winn", 77.77, "average", false, 0.8), + new Candidate("Suzie", "Sarandin", 69.93, "average", false, 0.0), + new Candidate("Philip", "Winne", 93.03, "average", true, 1.0), + new Candidate("Alex", "Trebok", 88.61, "poor", true, 0.7), + new Candidate("Emma", "Pivoto", 55.99, "excellent", false, 0.8), + new Candidate("John", "Lenthen", 87.49, "excellent", true, 0.9), + new Candidate("James", "Lean", 88.00, "excellent", false, 0.5), + new Candidate("Jane", "Ostin", 91.20, "average", true, 0.6), + new Candidate("Emily", "Car", 66.79, "excellent", false, 0.3), + new Candidate("Daniel", "Hamshire", 76.65, "average", true, 0.2), + new Candidate("Neda", "Bazdar", 55.89, "excellent", true, 0.5), + new Candidate("Aaron", "Smith", 90.01, "excellent", false, 0.3), + new Candidate("Kate", "Hen", 87.9, "poor", false, 0.8) + }; + + public CandidateTest(String testName) { + super(testName); + } + + public static Test suite() { + return new TestSuite(CandidateTest.class); + } + + public void testGetEligibleCandidates() { + assertTrue(true); + } +} |
