Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="lib" path="target/hamcrest-core-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="target/junit-4.13.jar"/>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
34 changes: 34 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>coding-competition</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1602383756483</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
2 changes: 2 additions & 0 deletions .settings/org.eclipse.jdt.apt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
9 changes: 9 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
1 change: 1 addition & 0 deletions debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[1010/231742.885:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
7 changes: 5 additions & 2 deletions feedback.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Your team (name of each individual participating):
Joshua Hadden & Scott Hunt
How many JUnits were you able to get to pass?
0 JUnits Passed

Document and describe any enhancements included to help the judges properly grade your submission.
Step 1:
Step 2:
No Enhancements


Feedback for the coding competition? Things you would like to see in future events?

Very difficult competition due to lack of assistance in setting up programming environment. Simply running JUnit tests got in the way of programming the actual problems. Directions were unclear as to where to begin programming. My team did not see the file with the included comments for how to proceed with passing the tests for the first hour and a half. As senior computer science students, this challenge was also way above our heads and this was a very difficult task that made us feel uncertain about our skills.
30 changes: 28 additions & 2 deletions src/main/java/sf/codingcompetition2020/CodingCompCsvUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MappingIterator;
import com.fasterxml.jackson.databind.ObjectReader;
Expand All @@ -31,8 +37,28 @@ public class CodingCompCsvUtil {
*/
public <T> List<T> readCsvFile(String filePath, Class<T> classType) {

}

int count = 0;
List<T> myList = new ArrayList<T>();
try{
File file = new File(filePath);
Scanner scanner = new Scanner(file);

scanner.useDelimiter(",");

while(scanner.hasNext())
{
T doc = (T)(scanner.getClass());
myList.add(doc);
}
scanner.close();
}
catch (FileNotFoundException fe)
{
fe.printStackTrace();
}

return myList;
}

/* #2
* getAgentCountInArea() -- Return the number of agents in a given area.
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/sf/codingcompetition2020/structures/Agent.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
package sf.codingcompetition2020.structures;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Agent {

private int agentId;
private String area;
private String language;
private String firstName;
private String lastName;

public String getFirstName()
{
return this.firstName;
}

public int getAgentCountInArea(String filepath, String area)
{
int count = 0;
try{
File file = new File(filepath);
Scanner scanner = new Scanner(file);

scanner.useDelimiter(",");

while(scanner.hasNext())
{
if(scanner.next().equals(area))
count++;
}
scanner.close();
}
catch (FileNotFoundException fe)
{
fe.printStackTrace();
}

return count;
}


}
5 changes: 5 additions & 0 deletions src/main/java/sf/codingcompetition2020/structures/Claim.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ public class Claim {
private int customerId;
private boolean closed;
private int monthsOpen;

public int getClaimId()
{
return this.claimId;
}

}
31 changes: 31 additions & 0 deletions src/main/java/sf/codingcompetition2020/structures/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
Expand All @@ -24,4 +27,32 @@ public class Customer {
private short yearsOfService;
private Integer vehiclesInsured;

public String getFirstName()
{
return this.firstName;
}

public int getAgentCountInArea(String filepath, String area)
{
int count = 0;
try{
File file = new File(filepath);
Scanner scanner = new Scanner(file);

scanner.useDelimiter(",");

while(scanner.hasNext())
{
if(scanner.next().equals(area))
count++;
}
scanner.close();
}
catch (FileNotFoundException fe)
{
fe.printStackTrace();
}

return count;
}
}
28 changes: 28 additions & 0 deletions src/main/java/sf/codingcompetition2020/structures/Vendor.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
package sf.codingcompetition2020.structures;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Vendor {
private int vendorId;
private String area;
private int vendorRating;
private boolean inScope;

public int getAgentCountInArea(String filepath, String area)
{
int count = 0;
try{
File file = new File(filepath);
Scanner scanner = new Scanner(file);

scanner.useDelimiter(",");

while(scanner.hasNext())
{
if(scanner.next().equals(area))
count++;
}
scanner.close();
}
catch (FileNotFoundException fe)
{
fe.printStackTrace();
}

return count;
}

}
5 changes: 0 additions & 5 deletions target/classes/META-INF/MANIFEST.MF

This file was deleted.

This file was deleted.

This file was deleted.

Binary file modified target/classes/sf/codingcompetition2020/CodingCompCsvUtil.class
Binary file not shown.
Binary file modified target/classes/sf/codingcompetition2020/structures/Agent.class
Binary file not shown.
Binary file modified target/classes/sf/codingcompetition2020/structures/Claim.class
Binary file not shown.
Binary file modified target/classes/sf/codingcompetition2020/structures/Customer.class
Binary file not shown.
Binary file modified target/classes/sf/codingcompetition2020/structures/Vendor.class
Binary file not shown.
Binary file added target/hamcrest-core-1.3.jar
Binary file not shown.
Binary file added target/junit-4.13.jar
Binary file not shown.
Binary file not shown.