diff --git a/loops-and-collections/.gitignore b/loops-and-collections/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..f35f60a357424aa265b3a6c1933c26af537c57ad --- /dev/null +++ b/loops-and-collections/.gitignore @@ -0,0 +1,62 @@ +# Mac file finder metadata +.DS_Store +# Windows file metadata +._* +# Thumbnail image caches +Thumbs.db +ethumbs.db +# MS Office temporary file +~* +# Emacs backup file +*~ + +# Common +[Bb]in/ +[Bb]uild/ +[Oo]bj/ +[Oo]ut/ +[Tt]mp/ +[Xx]86/ +[Ii][Aa]32/ +[Xx]64/ +[Xx]86_64/ +[Xx]86-64/ +[Aa]rm +[Aa]32 +[Tt]32 +[Aa]64 +*.tmp +*.bak +*.bk +*.swp + +# Java files +*.class +javadoc/ + +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + +# JetBrains (IntelliJ IDEA, PyCharm, etc) files +.idea/ +cmake-build-*/ +*.iml +*.iws +*.ipr + +# Eclipse files +.settings/ +.project +.classpath +.buildpath +.loadpath +.factorypath +local.properties diff --git a/loops-and-collections/pom.xml b/loops-and-collections/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..fac59a50ee3b95b38c01618a8c1a8706e9dd7f95 --- /dev/null +++ b/loops-and-collections/pom.xml @@ -0,0 +1,38 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>edu.unl.cse.soft160.loops</groupId> + <artifactId>loops_and_collections</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>jar</packaging> + + <name>loops_and_collections</name> + <url>http://maven.apache.org</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <build> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <source>11</source> + <target>11</target> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.13</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/loops-and-collections/src/main/java/edu/unl/cse/soft160/loops/Observation.java b/loops-and-collections/src/main/java/edu/unl/cse/soft160/loops/Observation.java new file mode 100644 index 0000000000000000000000000000000000000000..16bf0a44e71cd2251fe556d8da623dedb3c925c6 --- /dev/null +++ b/loops-and-collections/src/main/java/edu/unl/cse/soft160/loops/Observation.java @@ -0,0 +1,21 @@ +package edu.unl.cse.soft160.loops; + +import java.time.LocalDate; + +public class Observation { + private Double measurement; + private LocalDate date; + + public Observation(Double measurement, LocalDate date) { + this.measurement = measurement; + this.date = date; + } + + public Double getMeasurement() { + return measurement; + } + + public LocalDate getDate() { + return date; + } +} diff --git a/loops-and-collections/src/main/java/edu/unl/cse/soft160/loops/TemperatureAnalysis.java b/loops-and-collections/src/main/java/edu/unl/cse/soft160/loops/TemperatureAnalysis.java new file mode 100644 index 0000000000000000000000000000000000000000..613174b4606109569f4f19309b19164d930bdaac --- /dev/null +++ b/loops-and-collections/src/main/java/edu/unl/cse/soft160/loops/TemperatureAnalysis.java @@ -0,0 +1,32 @@ +package edu.unl.cse.soft160.loops; + +import java.util.ArrayList; +import java.util.List; +import java.time.LocalDate; + +public class TemperatureAnalysis { + /* TASK 1 */ + + public static LocalDate getDateForLowestTemperature(List<Observation> observations) { + return null; + } + + /* TASK 2 */ + + public static Double getLowestTemperatureBetweenTwoDates(List<Observation> observations, + LocalDate date1, LocalDate date2) { + return null; + } + + /* TASK 3 */ + + public static List<Double> getExtremeTemperatures(List<Observation> observations) { + return new ArrayList<Double>(); + } + + /* TASK 4 */ + + public static Double getMostRecentExtremeTemperature(List<Observation> observations) { + return null; + } +} diff --git a/loops-and-collections/src/test/java/edu/unl/cse/soft160/loops/.gitkeep b/loops-and-collections/src/test/java/edu/unl/cse/soft160/loops/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391