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