diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..1a99fc8
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..14a0591
--- /dev/null
+++ b/.project
@@ -0,0 +1,23 @@
+
+
+ 2020-StateFarm-CodingCompetitionProblem
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.m2e.core.maven2Nature
+
+
diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs
new file mode 100644
index 0000000..d4313d4
--- /dev/null
+++ b/.settings/org.eclipse.jdt.apt.core.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.apt.aptEnabled=false
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..c5689c2
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,118 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/.settings/org.springframework.ide.eclipse.xml.namespaces.prefs b/.settings/org.springframework.ide.eclipse.xml.namespaces.prefs
new file mode 100644
index 0000000..fc1e3b8
--- /dev/null
+++ b/.settings/org.springframework.ide.eclipse.xml.namespaces.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.springframework.ide.eclipse.xml.namespaces.default.version.check.classpath=true
+org.springframework.ide.eclipse.xml.namespaces.enable.project.preferences=false
+org.springframework.ide.eclipse.xml.namespaces.loadNamespaceHandlerFromClasspath=true
+org.springframework.ide.eclipse.xml.namespaces.use.https.for.new.namespace.locations=false
diff --git a/feedback.txt b/feedback.txt
index b931d50..57dc7e4 100644
--- a/feedback.txt
+++ b/feedback.txt
@@ -1,9 +1,14 @@
-Your team (name of each individual participating):
-How many JUnits were you able to get to pass?
+Your team (name of each individual participating): Giovanna Stern
+How many JUnits were you able to get to pass? Three of my tests passed. I completed writing methods for 1, 2, 3, 6, 8 and partially 5.
+Please note: None of my tests related to customers pass because I could not determine how to read in the dependent array. Instead, I adjusted some customer fields to constants for purposes of working on the program.
+I also was not able to complete any methods dealing with maps because I ran out of time to learn what they are.
Document and describe any enhancements included to help the judges properly grade your submission.
- Step 1:
+ Step 1:
Step 2:
Feedback for the coding competition? Things you would like to see in future events?
+Although I didn't get all tests to pass, I thought this was a great experience. I enjoyed that the problem was centered around a real-world scenario so that is something I would continue to do.
+I am currently a Freshman/Sophomore level in my studies so it gave me better insight on how I would apply what I am currently learning.
+I would also highly recommend future competitors to work in a team.
\ No newline at end of file
diff --git a/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java b/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java
index 58267da..7254d0b 100644
--- a/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java
+++ b/src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java
@@ -1,6 +1,9 @@
package sf.codingcompetition2020;
+import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileReader;
+
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
@@ -20,6 +23,7 @@
import sf.codingcompetition2020.structures.Claim;
import sf.codingcompetition2020.structures.Customer;
import sf.codingcompetition2020.structures.Vendor;
+import java.util.Scanner;
public class CodingCompCsvUtil {
@@ -30,7 +34,103 @@ public class CodingCompCsvUtil {
* @return -- List of entries being returned.
*/
public List readCsvFile(String filePath, Class classType) {
-
+ File file;
+ Scanner inputFile;
+ try {
+ file = new File(filePath);
+ inputFile = new Scanner(file);
+ }
+ catch (FileNotFoundException e) {
+ return null;
+ }
+
+
+ // Determine Class Type and add appropriate entries to list
+ String header = inputFile.nextLine();
+ String[] tokens = header.split(",");
+
+ if (tokens[0].equals("agentId")) {
+ List agentList = new ArrayList();
+
+ while(inputFile.hasNextLine()) {
+ String currentLine = inputFile.nextLine();
+
+ String[] aT = currentLine.split(",");
+ //use constructor to set Agent
+ int id = Integer.parseInt(aT[0]);
+ Agent currAgent = new Agent(id, aT[1], aT[2], aT[3], aT[4]);
+ agentList.add(currAgent);
+
+ }
+ inputFile.close();
+ return (List) agentList;
+ }
+ else if(tokens[0].equals("claimId")) {
+ List claimList = new ArrayList();
+
+ while(inputFile.hasNextLine()) {
+ String currentLine = inputFile.nextLine();
+
+ String[] param = currentLine.split(",");
+ //use constructor to set Claim
+ int claimID = Integer.parseInt(param[0]);
+ int custID = Integer.parseInt(param[1]);
+ boolean closed = Boolean.parseBoolean(param[2]);
+ int months = Integer.parseInt(param[3]);
+
+ Claim currClaim = new Claim(claimID, custID, closed, months);
+ claimList.add(currClaim);
+
+ }
+ inputFile.close();
+ return (List) claimList;
+
+ }
+ else if(tokens[0].equals("customerId")){
+ List customerList = new ArrayList();
+
+ while(inputFile.hasNextLine()) {
+ String currentLine = inputFile.nextLine();
+
+ String[] param = currentLine.split(",");
+ //Need to figure out how to read in dependent list
+ int custID = Integer.parseInt(param[0]);
+ int age = Integer.parseInt(param[3]);
+ int agentID = Integer.parseInt(param[5]);
+ short rating = Short.parseShort(param[6]);
+ boolean closed = Boolean.parseBoolean(param[2]);
+
+ //use constructor to set Customer
+ Customer currCustomer = new Customer(custID, param[1], param[2], age, param[4],agentID, rating, param[7]);
+ customerList.add(currCustomer);
+ }
+ inputFile.close();
+ return (List) customerList;
+
+ }
+ else if(tokens[0].equals("vendorId")) {
+ List vendorList = new ArrayList();
+
+ while(inputFile.hasNextLine()) {
+ String currentLine = inputFile.nextLine();
+ String[] param = currentLine.split(",");
+ int vendorId = Integer.parseInt(param[0]);
+ int rating = Integer.parseInt(param[2]);
+ boolean inScope = Boolean.parseBoolean(param[3]);
+
+ //use constructor to set vendor
+ Vendor currVendor = new Vendor(vendorId, param[1], rating, inScope);
+ vendorList.add(currVendor);
+
+ }
+ inputFile.close();
+ return (List) vendorList;
+
+ }
+
+ inputFile.close();
+ return null;
+
}
@@ -41,7 +141,16 @@ public List readCsvFile(String filePath, Class classType) {
* @return -- The number of agents in a given area
*/
public int getAgentCountInArea(String filePath,String area) {
-
+ List allAgentsList = readCsvFile(filePath, Agent.class);
+
+ int count = 0;
+
+ for(int i = 0; i < allAgentsList.size(); ++i) {
+ if(allAgentsList.get(i).getArea().equals(area)) {
+ count++;
+ }
+ }
+ return count;
}
@@ -53,6 +162,18 @@ public int getAgentCountInArea(String filePath,String area) {
* @return -- The number of agents in a given area
*/
public List getAgentsInAreaThatSpeakLanguage(String filePath, String area, String language) {
+
+ List allAgentsList = readCsvFile(filePath, Agent.class);
+
+ List agentList = new ArrayList();
+
+ for(int i = 0; i < allAgentsList.size(); ++i) {
+ if(allAgentsList.get(i).getArea().equals(area) && allAgentsList.get(i).getLanguage().equals(language)) {
+ // need if statement for dependents and cars
+ agentList.add(allAgentsList.get(i));
+ }
+ }
+ return agentList;
}
@@ -66,7 +187,8 @@ public List getAgentsInAreaThatSpeakLanguage(String filePath, String area
* @return -- The number of customers that use a certain agent in a given area.
*/
public short countCustomersFromAreaThatUseAgent(Map csvFilePaths, String customerArea, String agentFirstName, String agentLastName) {
-
+ //method not complete
+ return 0;
}
@@ -76,8 +198,21 @@ public short countCustomersFromAreaThatUseAgent(Map csvFilePaths,
* @param yearsOfServeice -- Number of years the person has been a customer.
* @return -- List of customers retained for a given number of years, in ascending order of policy cost.
*/
- public List getCustomersRetainedForYearsByPlcyCostAsc(String customerFilePath, short yearsOfService) {
-
+ public List getCustomersRetainedForYearsByPlcyCostAsc(String customerFilePath, short yearsOfService){
+ List allCustomersList = readCsvFile(customerFilePath, Customer.class);
+
+ List custRetainedForYearsByPlcyCostAscList = new ArrayList();
+
+ for(int i = 0; i < allCustomersList.size(); ++i) {
+ if(allCustomersList.get(i).getYearsOfService() == yearsOfService) {
+ custRetainedForYearsByPlcyCostAscList.add(allCustomersList.get(i));
+ }
+ }
+
+ //TODO sort list by ascending order of policy cost
+
+ return custRetainedForYearsByPlcyCostAscList;
+
}
@@ -88,7 +223,19 @@ public List getCustomersRetainedForYearsByPlcyCostAsc(String customerF
* @return -- List of customers who’ve made an inquiry for a policy but have not signed up.
*/
public List getLeadsForInsurance(String filePath) {
-
+
+ List allCustomersList = readCsvFile(filePath, Customer.class);
+
+ List customerLeadsList = new ArrayList();
+
+ for(int i = 0; i < allCustomersList.size(); ++i) {
+ if(allCustomersList.get(i).getHomePolicy() == false && allCustomersList.get(i).getRentersPolicy() == false &&
+ allCustomersList.get(i).getAutoPolicy() == false) {
+ customerLeadsList.add(allCustomersList.get(i));
+ }
+ }
+
+ return customerLeadsList;
}
@@ -103,7 +250,10 @@ b. Whether that vendor is in scope of the insurance (if inScope == false, return
* @return -- List of vendors within a given area, filtered by scope and vendor rating.
*/
public List getVendorsWithGivenRatingThatAreInScope(String filePath, String area, boolean inScope, int vendorRating) {
-
+ //Method not complete
+ List vendors = readCsvFile(filePath, Vendor.class);
+
+ return vendors;
}
@@ -117,7 +267,18 @@ public List getVendorsWithGivenRatingThatAreInScope(String filePath, Str
* @return -- List of customers filtered by age, number of vehicles insured and the number of dependents.
*/
public List getUndisclosedDrivers(String filePath, int vehiclesInsured, int dependents) {
-
+ List customers = readCsvFile(filePath, Customer.class);
+
+ List undisclosedList = new ArrayList();
+
+ for(int i = 0; i < customers.size(); ++i) {
+ if(customers.get(i).getAge() >= 40 && customers.get(i).getAge() <= 50) {
+ // need if statement for dependents and cars
+ undisclosedList.add(customers.get(i));
+ }
+ }
+
+ return undisclosedList;
}
@@ -130,7 +291,8 @@ public List getUndisclosedDrivers(String filePath, int vehiclesInsured
* @return -- Agent ID of agent with the given rank.
*/
public int getAgentIdGivenRank(String filePath, int agentRank) {
-
+ //method not complete
+ return 0;
}
@@ -141,7 +303,10 @@ public int getAgentIdGivenRank(String filePath, int agentRank) {
* @return -- List of customers who’ve filed a claim within the last .
*/
public List getCustomersWithClaims(Map csvFilePaths, short monthsOpen) {
-
+ //method not complete
+ List customers = readCsvFile(csvFilePaths.get(0), Customer.class);
+
+ return customers;
}
}
diff --git a/src/main/java/sf/codingcompetition2020/structures/Agent.java b/src/main/java/sf/codingcompetition2020/structures/Agent.java
index e2e6f93..9133bd8 100644
--- a/src/main/java/sf/codingcompetition2020/structures/Agent.java
+++ b/src/main/java/sf/codingcompetition2020/structures/Agent.java
@@ -8,4 +8,30 @@ public class Agent {
private String firstName;
private String lastName;
+ public Agent(int agentId, String area, String language, String firstName, String lastName) {
+ this.agentId = agentId;
+ this.area = area;
+ this.language = language;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getFirstName() {
+ // TODO Auto-generated method stub
+ return this.firstName;
+ }
+ public int getAgentId() {
+ // TODO Auto-generated method stub
+ return this.agentId;
+ }
+
+ public String getArea() {
+ return this.area;
+ }
+
+ public String getLanguage() {
+ return this.language;
+ }
+
+
}
diff --git a/src/main/java/sf/codingcompetition2020/structures/Claim.java b/src/main/java/sf/codingcompetition2020/structures/Claim.java
index 581140a..be7f419 100644
--- a/src/main/java/sf/codingcompetition2020/structures/Claim.java
+++ b/src/main/java/sf/codingcompetition2020/structures/Claim.java
@@ -6,4 +6,16 @@ public class Claim {
private boolean closed;
private int monthsOpen;
+ public Claim(int claimId, int customerId, boolean closed, int monthsOpen) {
+ this.claimId = claimId;
+ this.customerId = customerId;
+ this.closed = closed;
+ this.monthsOpen = monthsOpen;
+ }
+
+ public int getClaimId() {
+ // TODO Auto-generated method stub
+ return this.claimId;
+ }
+
}
diff --git a/src/main/java/sf/codingcompetition2020/structures/Customer.java b/src/main/java/sf/codingcompetition2020/structures/Customer.java
index f151906..d7f7edb 100644
--- a/src/main/java/sf/codingcompetition2020/structures/Customer.java
+++ b/src/main/java/sf/codingcompetition2020/structures/Customer.java
@@ -23,5 +23,85 @@ public class Customer {
private String totalMonthlyPremium;
private short yearsOfService;
private Integer vehiclesInsured;
+
+ //Constructor with fields until those after dependents
+ public Customer (int customerId, String firstName, String lastName, int age, String area, int agentId, short agentRating,
+ String primaryLanguage) {
+ this.customerId = customerId;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.age = age;
+ this.area = area;
+ this.agentId = agentId;
+ this.agentRating = agentRating;
+ this.primaryLanguage = primaryLanguage;
+ // Set below values to default values for testing because could not determine how to read in dependents
+ this.dependents = null;
+ this.homePolicy = false;
+ this.autoPolicy = true;
+ this.rentersPolicy = false;
+ this.totalMonthlyPremium = "100";
+ this.yearsOfService = 10;
+ this.vehiclesInsured = 2;
+ }
+
+ //overloaded constructor
+ public Customer (int customerId, String firstName, String lastName, int age, String area, int agentId, short agentRating,
+ String primaryLanguage, List dependents, boolean homePolicy, boolean autoPolicy, boolean rentersPolicy, String totalMonthlyPremium,
+ short yearsOfService, Integer vehiclesInsured) {
+ this.customerId = customerId;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.age = age;
+ this.area = area;
+ this.agentId = agentId;
+ this.agentRating = agentRating;
+ this.primaryLanguage = primaryLanguage;
+ this.dependents = dependents;
+ this.homePolicy = homePolicy;
+ this.autoPolicy = autoPolicy;
+ this.rentersPolicy = rentersPolicy;
+ this.totalMonthlyPremium = totalMonthlyPremium;
+ this.yearsOfService = yearsOfService;
+ this.vehiclesInsured = vehiclesInsured;
+ }
+
+
+ public String getFirstName() {
+ // TODO Auto-generated method stub
+ return this.firstName;
+ }
+ public int getCustomerId() {
+ // TODO Auto-generated method stub
+ return this.customerId;
+ }
+ public short getYearsOfService() {
+ // TODO Auto-generated method stub
+ return this.yearsOfService;
+ }
+ public String getTotalMonthlyPremium() {
+ // TODO Auto-generated method stub
+ return this.totalMonthlyPremium;
+ }
+ public String getLastName() {
+ // TODO Auto-generated method stub
+ return this.lastName;
+ }
+ public int getAge() {
+ return this.age;
+ }
+
+ public boolean getHomePolicy() {
+ return this.homePolicy;
+ }
+
+ public boolean getRentersPolicy() {
+ return this.rentersPolicy;
+ }
+
+ public boolean getAutoPolicy() {
+ return this.autoPolicy;
+ }
+
}
diff --git a/src/main/java/sf/codingcompetition2020/structures/Vendor.java b/src/main/java/sf/codingcompetition2020/structures/Vendor.java
index 6b6fb76..fdee75d 100644
--- a/src/main/java/sf/codingcompetition2020/structures/Vendor.java
+++ b/src/main/java/sf/codingcompetition2020/structures/Vendor.java
@@ -6,4 +6,11 @@ public class Vendor {
private int vendorRating;
private boolean inScope;
+ public Vendor(int vendorId, String area, int vendorRating, boolean inScope) {
+ this.vendorId = vendorId;
+ this.area = area;
+ this.vendorRating = vendorRating;
+ this.inScope = inScope;
+ }
+
}
diff --git a/target/classes/META-INF/MANIFEST.MF b/target/classes/META-INF/MANIFEST.MF
index e2a1a34..d3b3e37 100644
--- a/target/classes/META-INF/MANIFEST.MF
+++ b/target/classes/META-INF/MANIFEST.MF
@@ -1,5 +1,5 @@
Manifest-Version: 1.0
-Built-By: yc1d
-Build-Jdk: 1.8.0_201
+Built-By: temp
+Build-Jdk: 14.0.2
Created-By: Maven Integration for Eclipse
diff --git a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties
index fe569e3..1e2eb52 100644
--- a/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties
+++ b/target/classes/META-INF/maven/sf.codingcompetition2020/coding-competition/pom.properties
@@ -1,7 +1,7 @@
#Generated by Maven Integration for Eclipse
-#Thu Oct 08 09:27:33 MST 2020
-version=1.0.0-SNAPSHOT
+#Sat Oct 10 18:20:54 MST 2020
+m2e.projectLocation=/Users/temp/dev/2020-StateFarm-CodingCompetitionProblem
+m2e.projectName=2020-StateFarm-CodingCompetitionProblem
groupId=sf.codingcompetition2020
-m2e.projectName=coding-competition
-m2e.projectLocation=/Users/yc1d/Development/coding-competition/problem/online-competition
artifactId=coding-competition
+version=1.0.0-SNAPSHOT
diff --git a/target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class b/target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class
index 00daba9..1af1ce8 100644
Binary files a/target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class and b/target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class differ
diff --git a/target/classes/sf/codingcompetition2020/structures/Agent.class b/target/classes/sf/codingcompetition2020/structures/Agent.class
index 26bf31f..ab5fdfc 100644
Binary files a/target/classes/sf/codingcompetition2020/structures/Agent.class and b/target/classes/sf/codingcompetition2020/structures/Agent.class differ
diff --git a/target/classes/sf/codingcompetition2020/structures/Claim.class b/target/classes/sf/codingcompetition2020/structures/Claim.class
index 1ce796d..67a8140 100644
Binary files a/target/classes/sf/codingcompetition2020/structures/Claim.class and b/target/classes/sf/codingcompetition2020/structures/Claim.class differ
diff --git a/target/classes/sf/codingcompetition2020/structures/Customer.class b/target/classes/sf/codingcompetition2020/structures/Customer.class
index 844ea29..af91640 100644
Binary files a/target/classes/sf/codingcompetition2020/structures/Customer.class and b/target/classes/sf/codingcompetition2020/structures/Customer.class differ
diff --git a/target/classes/sf/codingcompetition2020/structures/Dependent.class b/target/classes/sf/codingcompetition2020/structures/Dependent.class
index 3ee505f..5e7c6a0 100644
Binary files a/target/classes/sf/codingcompetition2020/structures/Dependent.class and b/target/classes/sf/codingcompetition2020/structures/Dependent.class differ
diff --git a/target/classes/sf/codingcompetition2020/structures/Vendor.class b/target/classes/sf/codingcompetition2020/structures/Vendor.class
index fdbca9b..b5bb5e2 100644
Binary files a/target/classes/sf/codingcompetition2020/structures/Vendor.class and b/target/classes/sf/codingcompetition2020/structures/Vendor.class differ
diff --git a/target/test-classes/sf/codingcompetition2020/CodingCompCsvUtilTest.class b/target/test-classes/sf/codingcompetition2020/CodingCompCsvUtilTest.class
index 765ac60..fb3f842 100644
Binary files a/target/test-classes/sf/codingcompetition2020/CodingCompCsvUtilTest.class and b/target/test-classes/sf/codingcompetition2020/CodingCompCsvUtilTest.class differ