ソースを参照

Removed solution

Dan 7 年 前
コミット
b73dcff47f
共有4 個のファイルを変更した48 個の追加78 個の削除を含む
  1. 1
    1
      src/main/java/HelloWorld/HelloWorld.java
  2. 11
    19
      src/main/java/Math/Math.java
  3. 26
    26
      src/main/java/PrimativeTypes/PrimativeTypes.java
  4. 10
    32
      src/main/java/Strings/Strings.java

+ 1
- 1
src/main/java/HelloWorld/HelloWorld.java ファイルの表示

@@ -7,7 +7,7 @@ public class HelloWorld {
7 7
 
8 8
     //Should return hello world as a string
9 9
     public String helloWorld(){
10
-        return "Hello World";
10
+        return null;
11 11
     }
12 12
 
13 13
 }

+ 11
- 19
src/main/java/Math/Math.java ファイルの表示

@@ -7,65 +7,57 @@ public class Math {
7 7
 
8 8
     //Get the remainder from division
9 9
     public int remainder(int one, int two){
10
-        return one % two;
10
+        return 0;
11 11
     }
12 12
 
13 13
     //Return true using greater than symbol
14 14
     public boolean greaterThanTrue(int one, int two){
15
-        return one > two;
15
+        return false;
16 16
     }
17 17
 
18 18
     //Return false using greater than symbol
19 19
     public boolean greaterThanFalse(int one, int two){
20
-        return one > two;
20
+        return true;
21 21
     }
22 22
 
23 23
     //Return true using less than symbol
24 24
     public boolean lessThanTrue(int one, int two){
25
-        return one < two;
25
+        return false;
26 26
     }
27 27
 
28 28
     //Return false using less than symbol
29 29
     public boolean lessThanFalse(int one, int two){
30
-        return one < two;
30
+        return true;
31 31
     }
32 32
 
33 33
     //Return true using greater or equal symbol
34 34
     public boolean greaterOrEqualTrue(int one, int two){
35
-        return one >= two;
35
+        return false;
36 36
     }
37 37
 
38 38
     //Return false using greater or equal symbol
39 39
     public boolean greaterOrEqualFalse(int one, int two){
40
-        return one >= two;
40
+        return true;
41 41
     }
42 42
 
43 43
     //Return true using less than or equal symbol
44 44
     public boolean lessOrEqualTrue(int one, int two){
45
-        return one <= two;
45
+        return false;
46 46
     }
47 47
 
48 48
     //Return false using less than or equal symbol
49 49
     public boolean lessOrEqualFalse(int one, int two){
50
-        return one <= two;
50
+        return true;
51 51
     }
52 52
 
53 53
     //Return true if the number in parameter is equal to 3 and less than 90
54 54
     public boolean logicalAnd(Integer number){
55
-        if (number == 3 && number < 90){
56
-            return true;
57
-        }
58
-        else
59
-            return false;
55
+        return false;
60 56
     }
61 57
 
62 58
     //Return true if the number passed in is equal to 4 or greater than 100
63 59
     public boolean logicalOr(Integer number){
64
-        if (number == 4 || number > 100){
65
-            return true;
66
-        }
67
-        else
68
-            return false;
60
+        return false;
69 61
     }
70 62
 
71 63
 }

+ 26
- 26
src/main/java/PrimativeTypes/PrimativeTypes.java ファイルの表示

@@ -7,128 +7,128 @@ public class PrimativeTypes {
7 7
 
8 8
     //Add two ints and return the answer
9 9
     public int add(int x, int y){
10
-        return x + y;
10
+        return 0;
11 11
     }
12 12
 
13 13
     //Add two long's and return the answer
14 14
     public long add(long x, long y){
15
-        return x + y;
15
+        return 0;
16 16
     }
17 17
 
18 18
     //Add two short's and return the answer Must Type Cast
19 19
     public short add(short x, short y){
20
-        return (short) (x + y);
20
+        return 0;
21 21
     }
22 22
     //Add two bytes and return the answer, Must Type Cast
23 23
     public byte add(byte x, byte y){
24
-        return (byte) (x + y);
24
+        return 0;
25 25
     }
26 26
 
27 27
     //Add two floats and return the answer
28 28
     public float add(float x, float y){
29
-        return x + y;
29
+        return 0;
30 30
     }
31 31
 
32 32
     //Add two doubles and return the answer
33 33
     public double add(double x, double y){
34
-        return x + y;
34
+        return 0;
35 35
     }
36 36
 
37 37
     //Subtract two ints and return the answer
38 38
     public int subtract(int x, int y){
39
-        return x - y;
39
+        return 0;
40 40
     }
41 41
 
42 42
     //Subtract two long's and return the answer
43 43
     public long subtract(long x, long y){
44
-        return x - y;
44
+        return 0;
45 45
     }
46 46
 
47 47
     //Subtract two short's and return the answer Must Type Cast
48 48
     public short subtract(short x, short y){
49
-        return (short) (x - y);
49
+        return 0;
50 50
     }
51 51
     //Subtract two bytes and return the answer, Must Type Cast
52 52
     public byte subtract(byte x, byte y){
53
-        return (byte) (x - y);
53
+        return 0;
54 54
     }
55 55
 
56 56
     //Subtract two floats and return the answer
57 57
     public float subtract(float x, float y){
58
-        return x - y;
58
+        return 0;
59 59
     }
60 60
 
61 61
     //Subtract two doubles and return the answer
62 62
     public double subtract(double x, double y){
63
-        return x - y;
63
+        return 0;
64 64
     }
65 65
 
66 66
     //Divide two ints and return the answer
67 67
     public int divide(int x, int y){
68
-        return x / y;
68
+        return 0;
69 69
     }
70 70
 
71 71
     //Divide two long's and return the answer
72 72
     public long divide(long x, long y){
73
-        return x / y;
73
+        return 0;
74 74
     }
75 75
 
76 76
     //Divide two short's and return the answer Must Type Cast
77 77
     public short divide(short x, short y){
78
-        return (short) (x / y);
78
+        return 0;
79 79
     }
80 80
     //Divide two bytes and return the answer, Must Type Cast
81 81
     public byte divide(byte x, byte y){
82
-        return (byte) (x / y);
82
+        return 0;
83 83
     }
84 84
 
85 85
     //Divide two floats and return the answer
86 86
     public float divide(float x, float y){
87
-        return x / y;
87
+        return 0;
88 88
     }
89 89
 
90 90
     //Divide two doubles and return the answer
91 91
     public double divide(double x, double y){
92
-        return x / y;
92
+        return 0;
93 93
     }
94 94
 
95 95
     //Multiply two ints and return the answer
96 96
     public int multiply(int x, int y){
97
-        return x * y;
97
+        return 0;
98 98
     }
99 99
 
100 100
     //Multiply two long's and return the answer
101 101
     public long multiply(long x, long y){
102
-        return x * y;
102
+        return 0;
103 103
     }
104 104
 
105 105
     //Multiply two short's and return the answer Must Type Cast
106 106
     public short multiply(short x, short y){
107
-        return (short) (x * y);
107
+        return 0;
108 108
     }
109 109
     //Multiply two bytes and return the answer, Must Type Cast
110 110
     public byte multiply(byte x, byte y){
111
-        return (byte) (x * y);
111
+        return 0;
112 112
     }
113 113
 
114 114
     //Multiply two floats and return the answer
115 115
     public float multiply(float x, float y){
116
-        return x * y;
116
+        return 0;
117 117
     }
118 118
 
119 119
     //Multiply two doubles and return the answer
120 120
     public double multiply(double x, double y){
121
-        return x * y;
121
+        return 0;
122 122
     }
123 123
 
124 124
     //Return true
125 125
     public boolean returnTrue(){
126
-        return true;
126
+        return false;
127 127
     }
128 128
 
129 129
     //Return false
130 130
     public boolean returnFalse(){
131
-        return false;
131
+        return true;
132 132
     }
133 133
 
134 134
 }

+ 10
- 32
src/main/java/Strings/Strings.java ファイルの表示

@@ -7,74 +7,52 @@ public class Strings {
7 7
 
8 8
     //Concatenate two strings together that are passed in the parameters
9 9
     public String concatenation(String one, String two){
10
-        return one + two;
10
+        return null;
11 11
     }
12 12
 
13 13
     //Concatenate a string and a integer together that are passed in the parameters
14 14
     public String concatenation(int one, String two){
15
-        return one + two;
15
+        return null;
16 16
     }
17 17
 
18 18
     //Get the substring of the first three letters of a string
19 19
     public String subStringBegin(String input){
20
-        return input.substring(0,3);
20
+        return null;
21 21
     }
22 22
 
23 23
     //Get the substring of a string "Hello" so it returns the last three letters only
24 24
     public String subStringEnd(String input){
25
-        return input.substring(input.length() - 3, input.length());
25
+        return null;
26 26
     }
27 27
 
28 28
     //Compare the two strings using compareTo() and if they are return true, else false
29 29
     public boolean compareTwoStrings(String one, String two){
30
-        int comparison = one.compareTo(two);
31
-        if (comparison == 0){
32
-            return true;
33
-        }
34
-        else
35
-            return false;
30
+        return false;
36 31
     }
37 32
 
38 33
     //Compare the two strings using equals() and if they are return true, else false
39 34
     public boolean compareTwoStringsEqual(String one, String two){
40
-        return one.equals(two);
35
+        return false;
41 36
     }
42 37
 
43 38
     //Write a method that returns the middle character in the given string hint: use the .length and .charAt methods
44 39
     public char getTheMiddleChar(String string){
45
-        Integer middle = string.length()/2;
46
-        return string.charAt(middle);
40
+        return ' ';
47 41
     }
48 42
 
49 43
     //Use the indexOf method to find the first space in a string and .substring() to return the first word
50 44
     public String getTheFirstWord(String string){
51
-        Integer space = 0;
52
-        for (int i = 0; i < string.length(); i++){
53
-            if (string.charAt(i) == ' '){
54
-                space = i;
55
-            }
56
-        }
57
-        return string.substring(0, space);
45
+        return null;
58 46
     }
59 47
 
60 48
     //Use the same behavior to find the second word
61 49
     public String getTheSecondWord(String string){
62
-        Integer space = 0;
63
-        for (int i = 0; i < string.length(); i++){
64
-            if (string.charAt(i) == ' '){
65
-                space = i;
66
-            }
67
-        }
68
-        return string.substring(space + 1, string.length());
50
+        return null;
69 51
     }
70 52
 
71 53
     //Create a method that uses the above methods to return a string consisting of the second and first word in reversed order
72 54
     public String reverseTheTwo(String string){
73
-        StringBuilder sb = new StringBuilder();
74
-        sb.append(getTheSecondWord(string));
75
-        sb.append(" ");
76
-        sb.append(getTheFirstWord(string));
77
-        return sb.toString();
55
+        return null;
78 56
     }
79 57
 
80 58
 }