Clement Ojie 6 年前
父节点
当前提交
35b891bea1
共有 5 个文件被更改,包括 60 次插入22 次删除
  1. 二进制
      ConversionTool.class
  2. 21
    0
      ConversionTool.ctxt
  3. 32
    15
      ConversionTool.java
  4. 二进制
      ConversionToolSpec.class
  5. 7
    7
      package.bluej

二进制
ConversionTool.class 查看文件


+ 21
- 0
ConversionTool.ctxt 查看文件

@@ -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=centimeters
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=meters
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

+ 32
- 15
ConversionTool.java 查看文件

@@ -3,19 +3,36 @@ public class ConversionTool {
3 3
 
4 4
     public static void main(String[] args){}
5 5
 
6
-    public static float CentimetersToInches(float centimeters){}
7
-
8
-    public static float InchesToCentimeters(float inches){}
9
-
10
-    public static float FeetToMeters(float feet){}
11
-
12
-    public static float MetersToFeet(float meters){}
13
-
14
-    public static float CelsiusToFahrenheit(float celsius){}
15
-
16
-    public static float FahrenheitToCelsius(float fahrenheit){}
17
-
18
-    public static float MphToKph(float mph){}
19
-
20
-    public static float KphToMph(float kph){}
6
+    public static float CentimetersToInches(float centimeters){
7
+    return centimeters * (float)0.393701;
8
+    }
9
+
10
+    public static float InchesToCentimeters(float inches){
11
+        return inches * (float)2.54;
12
+    
13
+    }
14
+
15
+    public static float FeetToMeters(float feet){
16
+    return feet * (float)0.3048;
17
+    }
18
+
19
+    public static float MetersToFeet(float meters){
20
+    return meters * (float)3.28084;
21
+    }
22
+
23
+    public static float CelsiusToFahrenheit(float celsius){
24
+    return celsius + (float)32;
25
+    }
26
+
27
+    public static float FahrenheitToCelsius(float fahrenheit){
28
+    return fahrenheit - (float)32;
29
+    }
30
+
31
+    public static float MphToKph(float mph){
32
+    return mph * (float)1.60934;
33
+    }
34
+
35
+    public static float KphToMph(float kph){
36
+    return kph * (float)0.621371;
37
+    }
21 38
 }

二进制
ConversionToolSpec.class 查看文件


+ 7
- 7
package.bluej 查看文件

@@ -4,16 +4,16 @@ dependency1.to=ConversionTool
4 4
 dependency1.type=UsesDependency
5 5
 editor.fx.0.height=722
6 6
 editor.fx.0.width=800
7
-editor.fx.0.x=320
8
-editor.fx.0.y=75
9
-objectbench.height=164
7
+editor.fx.0.x=480
8
+editor.fx.0.y=23
9
+objectbench.height=165
10 10
 objectbench.width=776
11 11
 package.divider.horizontal=0.6
12
-package.divider.vertical=0.6845018450184502
13
-package.editor.height=364
12
+package.divider.vertical=0.6826568265682657
13
+package.editor.height=363
14 14
 package.editor.width=674
15
-package.editor.x=419
16
-package.editor.y=221
15
+package.editor.x=218
16
+package.editor.y=130
17 17
 package.frame.height=600
18 18
 package.frame.width=800
19 19
 package.numDependencies=1