Ver código fonte

Committing metric conversion

Navya Sanal 6 anos atrás
pai
commit
5a2264ce20
6 arquivos alterados com 150 adições e 15 exclusões
  1. BIN
      ConversionTool.class
  2. 21
    0
      ConversionTool.ctxt
  3. 80
    9
      ConversionTool.java
  4. BIN
      ConversionToolSpec.class
  5. 43
    0
      ConversionToolSpec.ctxt
  6. 6
    6
      package.bluej

BIN
ConversionTool.class Ver arquivo


+ 21
- 0
ConversionTool.ctxt Ver arquivo

@@ -0,0 +1,21 @@
1
+#BlueJ class context
2
+comment0.target=ConversionTool
3
+comment1.params=args
4
+comment1.target=void\ main(java.lang.String[])
5
+comment2.params=centimeter
6
+comment2.target=float\ CentimetersToInches(float)
7
+comment3.params=inches
8
+comment3.target=float\ InchesToCentimeters(float)
9
+comment4.params=feet
10
+comment4.target=float\ FeetToMeters(float)
11
+comment5.params=meter
12
+comment5.target=float\ MetersToFeet(float)
13
+comment6.params=celsius
14
+comment6.target=float\ CelsiusToFahrenheit(float)
15
+comment7.params=fahrenheit
16
+comment7.target=float\ FahrenheitToCelsius(float)
17
+comment8.params=mph
18
+comment8.target=float\ MphToKph(float)
19
+comment9.params=kph
20
+comment9.target=float\ KphToMph(float)
21
+numComments=10

+ 80
- 9
ConversionTool.java Ver arquivo

@@ -1,21 +1,92 @@
1 1
 public class ConversionTool {
2 2
 
3
+    public static void main(String[] args){
3 4
 
4
-    public static void main(String[] args){}
5
+    }
5 6
 
6
-    public static float CentimetersToInches(float centimeters){}
7
+    public static float CentimetersToInches(float centimeter){
8
+        if(centimeter > 0)
9
+        {
10
+            float inches = (float)0.3937 * centimeter;
11
+            return inches;
12
+        }
13
+        else
14
+            return 0;
7 15
 
8
-    public static float InchesToCentimeters(float inches){}
16
+    }
9 17
 
10
-    public static float FeetToMeters(float feet){}
18
+    public static float InchesToCentimeters(float inches){
19
+        if(inches > 0)
20
+        {
21
+            float centimeter = (float)2.54 * inches;
22
+            return centimeter;
23
+        }
24
+        else
25
+            return 0;
11 26
 
12
-    public static float MetersToFeet(float meters){}
27
+    }
13 28
 
14
-    public static float CelsiusToFahrenheit(float celsius){}
29
+    public static float FeetToMeters(float feet){
30
+        if(feet > 0)
31
+        {
32
+            float meter = (float)0.3048 * feet;
33
+            return meter;
34
+        }
35
+        else
36
+            return 0;
37
+    }
15 38
 
16
-    public static float FahrenheitToCelsius(float fahrenheit){}
39
+    public static float MetersToFeet(float meter){
40
+        if(meter > 0)
41
+        {
42
+            float feet = (float)3.28084 * meter;
43
+            return feet;
44
+        }
45
+        else
46
+            return 0;
47
+    }
17 48
 
18
-    public static float MphToKph(float mph){}
49
+    public static float CelsiusToFahrenheit(float celsius){
50
+        if(celsius > 0)
51
+        {
52
+            float fahrenheit =(float) (celsius* 1.8 + 32);
53
+            return fahrenheit;
54
+        }
55
+        else
56
+            return 0;
57
+
58
+    }
59
+
60
+    public static float FahrenheitToCelsius(float fahrenheit){
61
+        if(fahrenheit > 0)
62
+        {
63
+            float celsius = (float)((fahrenheit -32 )* 0.5556);
64
+            return celsius;
65
+        }
66
+        else
67
+        {
68
+            return 0;
69
+        }
70
+    }
71
+
72
+    public static float MphToKph(float mph){
73
+        if(mph > 0)
74
+        {
75
+            float kph = (float)1.60934 * mph;
76
+            return kph;
77
+        }
78
+        else
79
+            return 0;
80
+    }
81
+
82
+    public static float KphToMph(float kph){
83
+        if(kph > 0)
84
+        {
85
+            float mph = (float)0.621371 * kph;
86
+            return mph;
87
+        }
88
+        else
89
+            return 0;
90
+    }
19 91
 
20
-    public static float KphToMph(float kph){}
21 92
 }

BIN
ConversionToolSpec.class Ver arquivo


+ 43
- 0
ConversionToolSpec.ctxt Ver arquivo

@@ -0,0 +1,43 @@
1
+#BlueJ class context
2
+comment0.target=ConversionToolSpec
3
+comment1.params=
4
+comment1.target=void\ shouldConvertCentimetersToInches()
5
+comment10.params=
6
+comment10.target=void\ shouldConvertMetersToFeet()
7
+comment11.params=
8
+comment11.target=void\ shouldConvertZeroMetersToZeroFeet()
9
+comment12.params=
10
+comment12.target=void\ shouldConvertNegativeMetersToZeroFeet()
11
+comment13.params=
12
+comment13.target=void\ shouldConvertFahrenheitToCelsius()
13
+comment14.params=
14
+comment14.target=void\ shouldConvertCelsiusToFahrenheit()
15
+comment15.params=
16
+comment15.target=void\ shouldConvertMphToKph()
17
+comment16.params=
18
+comment16.target=void\ shouldConvertZeroMphToZeroKph()
19
+comment17.params=
20
+comment17.target=void\ shouldConvertNegativeMphToZeroKph()
21
+comment18.params=
22
+comment18.target=void\ shouldConvertKphToMph()
23
+comment19.params=
24
+comment19.target=void\ shouldConvertZeroKphToZeroMph()
25
+comment2.params=
26
+comment2.target=void\ shouldConvertZeroCentimetersToZeroInches()
27
+comment20.params=
28
+comment20.target=void\ shouldConvertNegativeKphToZeroMph()
29
+comment3.params=
30
+comment3.target=void\ shouldConvertNegativeCentimetersToZeroInches()
31
+comment4.params=
32
+comment4.target=void\ shouldConvertInchesToCentimeters()
33
+comment5.params=
34
+comment5.target=void\ shouldConvertZeroInchesToZeroCentimeters()
35
+comment6.params=
36
+comment6.target=void\ shouldConvertNegativeInchesToZeroCentimeters()
37
+comment7.params=
38
+comment7.target=void\ shouldConvertFeetToMeters()
39
+comment8.params=
40
+comment8.target=void\ shouldConvertZeroFeetToZeroMeters()
41
+comment9.params=
42
+comment9.target=void\ shouldConvertNegativeFeetToZeroMeters()
43
+numComments=21

+ 6
- 6
package.bluej Ver arquivo

@@ -2,12 +2,12 @@
2 2
 dependency1.from=ConversionToolSpec
3 3
 dependency1.to=ConversionTool
4 4
 dependency1.type=UsesDependency
5
-editor.fx.0.height=722
6
-editor.fx.0.width=800
7
-editor.fx.0.x=320
8
-editor.fx.0.y=75
5
+editor.fx.0.height=0
6
+editor.fx.0.width=0
7
+editor.fx.0.x=0
8
+editor.fx.0.y=0
9 9
 objectbench.height=164
10
-objectbench.width=776
10
+objectbench.width=461
11 11
 package.divider.horizontal=0.6
12 12
 package.divider.vertical=0.6845018450184502
13 13
 package.editor.height=364
@@ -29,7 +29,7 @@ readme.y=10
29 29
 target1.height=50
30 30
 target1.name=ConversionToolSpec
31 31
 target1.showInterface=false
32
-target1.type=ClassTarget
32
+target1.type=UnitTestTargetJunit4
33 33
 target1.width=150
34 34
 target1.x=130
35 35
 target1.y=10