Clement Ojie пре 6 година
родитељ
комит
35b891bea1
5 измењених фајлова са 60 додато и 22 уклоњено
  1. BIN
      ConversionTool.class
  2. 21
    0
      ConversionTool.ctxt
  3. 32
    15
      ConversionTool.java
  4. BIN
      ConversionToolSpec.class
  5. 7
    7
      package.bluej

BIN
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
 }

BIN
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