12345678910111213141516171819202122232425262728293031323334353637383940 |
- public class ConversionTool {
-
-
- public static void main(String[] args){
-
- }
-
- public static float CentimetersToInches(float centimeters){
- return centimeters < 0 ? 0 : centimeters * 0.393701f;
- }
-
- public static float InchesToCentimeters(float inches){
- return inches < 0 ? 0 : inches * 2.54f;
- }
-
- public static float FeetToMeters(float feet){
- return feet < 0 ? 0 : feet * 0.3048f;
- }
-
- public static float MetersToFeet(float meters){
- return meters < 0 ? 0 : meters * 3.28084f;
- }
-
- public static float CelsiusToFahrenheit(float celsius){
- return (celsius * 1.8f) + 32;
- }
-
- public static float FahrenheitToCelsius(float fahrenheit){
- return (fahrenheit - 32) / 1.8f;
- }
-
- public static float MphToKph(float mph){
- return mph < 0 ? 0 : mph * 1.60934f;
- }
-
- public static float KphToMph(float kph){
- return kph < 0 ? 0 : kph * 0.62137f;
- }
- }
|