Sfoglia il codice sorgente

arrays update, halfway done

Whitney Martinez 6 anni fa
parent
commit
85f07c37ac

+ 13
- 0
arraz/.idea/libraries/Maven__junit_junit_4_0.xml Vedi File

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: junit:junit:4.0">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 8
- 0
arraz/.idea/modules.xml Vedi File

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

+ 0
- 16
arraz/arraz.iml Vedi File

@@ -1,16 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
4
-    <output url="file://$MODULE_DIR$/target/classes" />
5
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
-    <content url="file://$MODULE_DIR$">
7
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10
-      <excludeFolder url="file://$MODULE_DIR$/target" />
11
-    </content>
12
-    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
13
-    <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="library" name="Maven: junit:junit:4.0" level="project" />
15
-  </component>
16
-</module>

+ 4
- 0
arraz/src/main/java/MoreArrayc.java Vedi File

@@ -0,0 +1,4 @@
1
+package PACKAGE_NAME;
2
+
3
+public class MoreArrayc {
4
+}

+ 4
- 0
arraz/src/main/java/OddsAndEvens.java Vedi File

@@ -0,0 +1,4 @@
1
+package PACKAGE_NAME;
2
+
3
+public class OddsAndEvens {
4
+}

+ 4
- 0
arraz/src/main/java/OddsAndEvensMethods.java Vedi File

@@ -0,0 +1,4 @@
1
+package PACKAGE_NAME;
2
+
3
+public class OddsAndEvensMethods {
4
+}

+ 48
- 0
arraz/src/test/java/MoreArraysTest.java Vedi File

@@ -0,0 +1,48 @@
1
+import org.junit.Assert;
2
+import org.junit.Test;
3
+
4
+public class MoreArraysTest {
5
+
6
+
7
+
8
+    @Test
9
+    public void findIndexOfTest() {
10
+        //Given
11
+        int[] arr = {5, 1, 7, 8, 9, 4, 3};
12
+        int value = 8;
13
+
14
+
15
+        //When
16
+
17
+       int container = MoreArrayz.
18
+
19
+
20
+        //Then
21
+        Assert.assertEquals(3, container);
22
+
23
+    }
24
+
25
+    @Test
26
+    public void findIndexOfTest2(){
27
+        //Given
28
+        int [] arr = {5,1,7,8,9,4,3};
29
+        int value = 5;
30
+        int container = 0;
31
+
32
+        //When
33
+
34
+        for (int i = 0; i < arr.length; i++) {
35
+
36
+            if(arr[i] == value){
37
+                container = i;
38
+
39
+            }
40
+        }
41
+
42
+
43
+        //Then
44
+        Assert.assertEquals(3,container);
45
+
46
+
47
+    }
48
+}

+ 4
- 0
arraz/src/test/java/OddsAndEventsTest.java Vedi File

@@ -0,0 +1,4 @@
1
+package PACKAGE_NAME;
2
+
3
+public class OddsAndEventsTest {
4
+}