123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- public class ConversionTool {
-
-
- public static void main(String[] args){
- }
-
- public static float CentimetersToInches(float centimeters){
- if (centimeters > 0) return centimeters * (float) 0.393701;
- else return 0;
- }
-
- public static float InchesToCentimeters(float inches){
- if (inches > 0) return inches / (float) 0.393701;
- else return 0;
- }
-
- public static float FeetToMeters(float feet){
- if (feet > 0) return feet / (float) 3.28084;
- else return 0;
- }
-
- public static float MetersToFeet(float meters){
- if (meters > 0) return meters * (float) 3.28084;
- else return 0;
- }
-
- public static float CelsiusToFahrenheit(float celsius){
- return (celsius * (float) 1.8) + 32;
- }
-
- public static float FahrenheitToCelsius(float fahrenheit){
- return (fahrenheit - 32) / (float) 1.8;
- }
-
- public static float MphToKph(float mph){
- if (mph > 0) return mph * (float) 1.60934;
- else return 0;
- }
-
- public static float KphToMph(float kph){
- if (kph > 0) return kph / (float) 1.60934;
- else return 0;
- }
- }
|