Browse Source

merge busted class files

Karousha Fennimore 6 years ago
parent
commit
b1d8157b82

+ 6
- 57
.gitignore View File

1
-er-specific stuff:
2
-.idea/**/workspace.xml
3
-.idea/**/tasks.xml
4
-.idea/dictionaries
5
-
6
-# Sensitive or high-churn files:
7
-.idea/**/dataSources/
8
-.idea/**/dataSources.ids
9
-.idea/**/dataSources.xml
10
-.idea/**/dataSources.local.xml
11
-.idea/**/sqlDataSources.xml
12
-.idea/**/dynamic.xml
13
-.idea/**/uiDesigner.xml
14
-
15
-# Gradle:
16
-.idea/**/gradle.xml
17
-.idea/**/libraries
18
-
19
-# CMake
20
-cmake-build-debug/
21
-
22
-# Mongo Explorer plugin:
23
-.idea/**/mongoSettings.xml
24
-
25
-## File-based project format:
26
-*.iws
27
-
28
-## Plugin-specific files:
29
-
30
-# IntelliJ
31
-/out/
32
-
33
-# mpeltonen/sbt-idea plugin
34
-.idea_modules/
35
-
36
-# JIRA plugin
37
-atlassian-ide-plugin.xml
38
-
39
-# Cursive Clojure plugin
40
-.idea/replstate.xml
41
-
42
-# Crashlytics plugin (for Android Studio and IntelliJ)
43
-com_crashlytics_export_strings.xml
44
-crashlytics.properties
45
-crashlytics-build.properties
46
-fabric.properties
47
-
48
-### Intellij Patch ###
49
-# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
50
-
51
-# *.iml
52
-# modules.xml
53
-# .idea/misc.xml
54
-# *.ipr
55
-
56
-# Sonarlint plugin
57
-.idea/sonarlint
1
+/target/
2
+.DS_Store
3
+.classpath
4
+#.project
5
+.settings
6
+.idea/

+ 0
- 1
.idea/.name View File

1
-ChapterOneMicro

+ 0
- 16
.idea/compiler.xml View File

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="CompilerConfiguration">
4
-    <annotationProcessing>
5
-      <profile name="Maven default annotation processors profile" enabled="true">
6
-        <sourceOutputDir name="target/generated-sources/annotations" />
7
-        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
-        <outputRelativeToContentRoot value="true" />
9
-        <module name="ChapterOneMicro" />
10
-      </profile>
11
-    </annotationProcessing>
12
-    <bytecodeTargetLevel target="1.8">
13
-      <module name="ChapterOneMicro" target="1.8" />
14
-    </bytecodeTargetLevel>
15
-  </component>
16
-</project>

+ 0
- 7
.idea/kotlinc.xml View File

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="KotlinCommonCompilerArguments">
4
-    <option name="languageVersion" value="1.1" />
5
-    <option name="apiVersion" value="1.1" />
6
-  </component>
7
-</project>

+ 0
- 90
.idea/misc.xml View File

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="MavenProjectsManager">
4
-    <option name="originalFiles">
5
-      <list>
6
-        <option value="$PROJECT_DIR$/pom.xml" />
7
-      </list>
8
-    </option>
9
-  </component>
10
-  <component name="ProjectInspectionProfilesVisibleTreeState">
11
-    <entry key="Project Default">
12
-      <profile-state>
13
-        <expanded-state>
14
-          <State>
15
-            <id />
16
-          </State>
17
-        </expanded-state>
18
-        <selected-state>
19
-          <State>
20
-            <id>Android</id>
21
-          </State>
22
-        </selected-state>
23
-      </profile-state>
24
-    </entry>
25
-  </component>
26
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
27
-    <output url="file://$PROJECT_DIR$/classes" />
28
-  </component>
29
-  <component name="masterDetails">
30
-    <states>
31
-      <state key="GlobalLibrariesConfigurable.UI">
32
-        <settings>
33
-          <splitter-proportions>
34
-            <option name="proportions">
35
-              <list>
36
-                <option value="0.2" />
37
-              </list>
38
-            </option>
39
-          </splitter-proportions>
40
-        </settings>
41
-      </state>
42
-      <state key="JdkListConfigurable.UI">
43
-        <settings>
44
-          <last-edited>1.8</last-edited>
45
-          <splitter-proportions>
46
-            <option name="proportions">
47
-              <list>
48
-                <option value="0.2" />
49
-              </list>
50
-            </option>
51
-          </splitter-proportions>
52
-        </settings>
53
-      </state>
54
-      <state key="ProjectJDKs.UI">
55
-        <settings>
56
-          <last-edited>1.8</last-edited>
57
-          <splitter-proportions>
58
-            <option name="proportions">
59
-              <list>
60
-                <option value="0.2" />
61
-              </list>
62
-            </option>
63
-          </splitter-proportions>
64
-        </settings>
65
-      </state>
66
-      <state key="ProjectLibrariesConfigurable.UI">
67
-        <settings>
68
-          <splitter-proportions>
69
-            <option name="proportions">
70
-              <list>
71
-                <option value="0.2" />
72
-              </list>
73
-            </option>
74
-          </splitter-proportions>
75
-        </settings>
76
-      </state>
77
-      <state key="ScopeChooserConfigurable.UI">
78
-        <settings>
79
-          <splitter-proportions>
80
-            <option name="proportions">
81
-              <list>
82
-                <option value="0.2" />
83
-              </list>
84
-            </option>
85
-          </splitter-proportions>
86
-        </settings>
87
-      </state>
88
-    </states>
89
-  </component>
90
-</project>

+ 0
- 8
.idea/modules.xml View File

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="ProjectModuleManager">
4
-    <modules>
5
-      <module fileurl="file://$PROJECT_DIR$/ChapterOneMicro.iml" filepath="$PROJECT_DIR$/ChapterOneMicro.iml" />
6
-    </modules>
7
-  </component>
8
-</project>

+ 0
- 6
.idea/vcs.xml View File

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="VcsDirectoryMappings">
4
-    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
-  </component>
6
-</project>

+ 29
- 29
README.md View File

1
 # Java Fundamentals
1
 # Java Fundamentals
2
 
2
 
3
-* **Objective:**
4
-    * To complete the method stubs in each of the provided classes
5
-        * `MathUtilities`
6
-    	* `PredicateUtilities`
7
-    	* `StringUtilities`
8
-
9
-* **Purpose:**
10
-    * To establish familiarity with
11
-        * [primitive data-types](http://cs.fit.edu/~ryan/java/language/java-data.html)
12
-        * [method signatures and return statements](http://www.homeandlearn.co.uk/java/java_methods.html)
13
-        * [String operations](https://www.tutorialspoint.com/java/java_strings.htm)
14
-    
15
-* **Classes to be completed:**
3
+### **Objective:**
4
+* To complete the method stubs in each of the provided classes
16
 	* `MathUtilities`
5
 	* `MathUtilities`
17
 	* `PredicateUtilities`
6
 	* `PredicateUtilities`
18
 	* `StringUtilities`
7
 	* `StringUtilities`
8
+
9
+### **Purpose:**
10
+* To establish familiarity with
11
+    * [primitive data-types](http://cs.fit.edu/~ryan/java/language/java-data.html)
12
+    * [method signatures and return statements](http://www.homeandlearn.co.uk/java/java_methods.html)
13
+    * [String operations](https://www.tutorialspoint.com/java/java_strings.htm)
14
+    
15
+### **Classes to be completed:**
16
+* `MathUtilities`
17
+* `PredicateUtilities`
18
+* `StringUtilities`
19
 	
19
 	
20
-* **Instructions**
20
+### **Instructions:**
21
 
21
 
22
-    1. Fork this Repository
23
-        * [fork](https://help.github.com/articles/fork-a-repo/) this repository to your personal github account 
24
-        * [clone](https://help.github.com/articles/cloning-a-repository/) **your** `forked` repository to your local machine.
25
-        * Complete steps 2 and 3  
26
-        * `git add` your changes to the list of your `commited` files.
27
-        * `git commit` your added files to the list of your `staged` files.
28
-        * `git push` your staged files to your remote repository.
29
-        * submit a `pull request` which compares Zipcoder `master` to your `master`.
30
-    2. Begin by first ensuring the `main` method in your `ZipcodeRocks` class prints `"Zipcode Rocks!"` upon execution.  
31
-    3. Complete each of the method stubs in each of the `main` classes provided.
32
-        * `main` classes are located in `src.main.java.com.zipcodewilmington.danny_do_better_exercises`
33
-        * There are comments above each method stub to describe the expected behavior.
34
-    4. Upon completion, open and run the `TestSuite` class to ensure that all tests have 100% success.
35
-        * `TestSuite` is located in `src.test.java.com.zipcodewilmington.danny_do_better_exercises`
22
+1. Fork this Repository
23
+    * [fork](https://help.github.com/articles/fork-a-repo/) this repository to your personal github account 
24
+    * [clone](https://help.github.com/articles/cloning-a-repository/) **your** `forked` repository to your local machine.
25
+    * Complete steps 2 and 3  
26
+    * `git add` your changes to the list of your `commited` files.
27
+    * `git commit` your added files to the list of your `staged` files.
28
+    * `git push` your staged files to your remote repository.
29
+    * submit a `pull request` which compares Zipcoder `master` to your `master`.
30
+2. Begin by first ensuring the `main` method in your `ZipcodeRocks` class prints `"Zipcode Rocks!"` upon execution.  
31
+3. Complete each of the method stubs in each of the `main` classes provided.
32
+    * `main` classes are located in `src.main.java.com.zipcodewilmington.danny_do_better_exercises`
33
+    * There are comments above each method stub to describe the expected behavior.
34
+4. Upon completion, open and run the `TestSuite` class to ensure that all tests have 100% success.
35
+    * `TestSuite` is located in `src.test.java.com.zipcodewilmington.danny_do_better_exercises`
36
 
36
 
37
 ## Predicate Utilities
37
 ## Predicate Utilities
38
 * A _predicate_ is a clause which states something about a subject. (_e.g., **is assigning**_ in _"Leon **is assigning** homework"_)
38
 * A _predicate_ is a clause which states something about a subject. (_e.g., **is assigning**_ in _"Leon **is assigning** homework"_)
86
 	* `Character getMiddleCharacter(String)`
86
 	* `Character getMiddleCharacter(String)`
87
 	* `String getFirstWord(String)`
87
 	* `String getFirstWord(String)`
88
 	* `String getSecondWord(String)`
88
 	* `String getSecondWord(String)`
89
-	* `String reverseTheTwo(String)`
89
+	* `String reverse(String)`
90
 	
90
 	
91
 	
91
 	
92
 ## Whats next?
92
 ## Whats next?

+ 1
- 1
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java View File

82
      * @param stringToReverse
82
      * @param stringToReverse
83
      * @return an identical string with characters in reverse order.
83
      * @return an identical string with characters in reverse order.
84
      */
84
      */
85
-    public static String reverseTheTwo(String stringToReverse){
85
+    public static String reverse(String stringToReverse){
86
         return null;
86
         return null;
87
     }
87
     }
88
 }
88
 }

+ 2
- 2
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.java View File

36
         // : Given
36
         // : Given
37
         short baseValue = 16384;
37
         short baseValue = 16384;
38
         short addedValue = 7;
38
         short addedValue = 7;
39
-        short expected = 32767;
39
+        short expected = 16391;
40
         // : When
40
         // : When
41
         short actual = primativeTypes.add(baseValue, addedValue);
41
         short actual = primativeTypes.add(baseValue, addedValue);
42
         // : Then
42
         // : Then
146
         // : When
146
         // : When
147
         float actualFloat = primativeTypes.subtract(baseValue,difference);
147
         float actualFloat = primativeTypes.subtract(baseValue,difference);
148
         // : Then
148
         // : Then
149
-        assertEquals(expectedFloat,actualFloat, 0);
149
+        assertEquals(expectedFloat,actualFloat, 0.005);
150
     }
150
     }
151
     @Test
151
     @Test
152
     public void testSubtractions5() {
152
     public void testSubtractions5() {

+ 13
- 12
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.java View File

1
 package com.zipcodewilmington.danny_do_better_exercises;
1
 package com.zipcodewilmington.danny_do_better_exercises;
2
 
2
 
3
 import org.junit.Test;
3
 import org.junit.Test;
4
+
4
 import static org.junit.Assert.*;
5
 import static org.junit.Assert.*;
6
+
5
 /**
7
 /**
6
  * Created by dan on 6/14/17.
8
  * Created by dan on 6/14/17.
7
  */
9
  */
9
     private static volatile PredicateUtilities math = new PredicateUtilities();
11
     private static volatile PredicateUtilities math = new PredicateUtilities();
10
 
12
 
11
     @Test
13
     @Test
12
-    public void testGreaterThanTrue(){
14
+    public void testGreaterThanTrue() {
13
         // : Given
15
         // : Given
14
         int greaterValue = 450;
16
         int greaterValue = 450;
15
         int lesserValue = 350;
17
         int lesserValue = 350;
24
 
26
 
25
 
27
 
26
     @Test
28
     @Test
27
-    public void testGreaterThanFalse(){
29
+    public void testGreaterThanFalse() {
28
         // : Given
30
         // : Given
29
         int greaterValue = 350;
31
         int greaterValue = 350;
30
         int lesserValue = 350;
32
         int lesserValue = 350;
33
         boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
35
         boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
34
 
36
 
35
         // : Then
37
         // : Then
36
-        assertTrue(outcome);
38
+        assertFalse(outcome);
37
     }
39
     }
38
 
40
 
39
 
41
 
40
     @Test
42
     @Test
41
-    public void testLessThanTrue(){
43
+    public void testLessThanTrue() {
42
         // : Given
44
         // : Given
43
         int greaterValue = 450;
45
         int greaterValue = 450;
44
         int lesserValue = 350;
46
         int lesserValue = 350;
51
     }
53
     }
52
 
54
 
53
 
55
 
54
-
55
     @Test
56
     @Test
56
-    public void testLessThan1(){
57
+    public void testLessThan1() {
57
         // : Given
58
         // : Given
58
         int greaterValue = 450;
59
         int greaterValue = 450;
59
         int lesserValue = 350;
60
         int lesserValue = 350;
62
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
63
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
63
 
64
 
64
         // : Then
65
         // : Then
65
-        assertTrue(outcome);
66
+        assertFalse(outcome);
66
     }
67
     }
67
 
68
 
68
 
69
 
69
     @Test
70
     @Test
70
-    public void testLessOrEqual1(){
71
+    public void testLessOrEqual1() {
71
         // : Given
72
         // : Given
72
         int greaterValue = 3;
73
         int greaterValue = 3;
73
         int lesserValue = 3;
74
         int lesserValue = 3;
80
     }
81
     }
81
 
82
 
82
     @Test
83
     @Test
83
-    public void testLessOrEqual2(){
84
+    public void testLessOrEqual2() {
84
         // : Given
85
         // : Given
85
         int greaterValue = 3;
86
         int greaterValue = 3;
86
         int lesserValue = 6;
87
         int lesserValue = 6;
93
     }
94
     }
94
 
95
 
95
     @Test
96
     @Test
96
-    public void testGreaterOrEqual1(){
97
+    public void testGreaterOrEqual1() {
97
         // : Given
98
         // : Given
98
         int greaterValue = 4;
99
         int greaterValue = 4;
99
         int lesserValue = 4;
100
         int lesserValue = 4;
107
 
108
 
108
 
109
 
109
     @Test
110
     @Test
110
-    public void testGreaterOrEqual2(){
111
+    public void testGreaterOrEqual2() {
111
         // : Given
112
         // : Given
112
         int greaterValue = 8;
113
         int greaterValue = 8;
113
         int lesserValue = 15;
114
         int lesserValue = 15;
116
         boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
117
         boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
117
 
118
 
118
         // : Then
119
         // : Then
119
-        assertTrue(outcome);
120
+        assertFalse(outcome);
120
     }
121
     }
121
 }
122
 }

+ 6
- 6
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.java View File

56
     public void substringBeginTest(){
56
     public void substringBeginTest(){
57
         // : Given
57
         // : Given
58
         String input = "Hello";
58
         String input = "Hello";
59
-        String expected = "olleH";
59
+        String expected = "Hel";
60
 
60
 
61
         // : When
61
         // : When
62
         String actual = StringUtilities.getPrefix(input);
62
         String actual = StringUtilities.getPrefix(input);
109
     public void getTheMiddleChar1(){
109
     public void getTheMiddleChar1(){
110
         // : Given
110
         // : Given
111
         String input = "Zipcode";
111
         String input = "Zipcode";
112
-        char expected = 'c';
112
+        Character expected = 'c';
113
 
113
 
114
         // : When
114
         // : When
115
-        char actual = StringUtilities.getMiddleCharacter(input);
115
+        Character actual = StringUtilities.getMiddleCharacter(input);
116
 
116
 
117
         // : Then
117
         // : Then
118
-        Assert.assertEquals(expected, actual);
118
+        Assert.assertEquals(expected.toString(), actual.toString());
119
     }
119
     }
120
 
120
 
121
 
121
 
154
         String expected = "Wilmington";
154
         String expected = "Wilmington";
155
 
155
 
156
         // : When
156
         // : When
157
-        String actual = StringUtilities.getFirstWord(input);
157
+        String actual = StringUtilities.getSecondWord(input);
158
 
158
 
159
         // : Then
159
         // : Then
160
         assertEquals(expected, actual);
160
         assertEquals(expected, actual);
168
 
168
 
169
 
169
 
170
         // : When
170
         // : When
171
-        String actual = StringUtilities.reverseTheTwo(input);
171
+        String actual = StringUtilities.reverse(input);
172
 
172
 
173
         // : Then
173
         // : Then
174
         assertEquals(expected, actual);
174
         assertEquals(expected, actual);

BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/MathUtilities.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/ZipcodeRocks.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestSuite.class View File