123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- public class ConversionTool {
-
-
- public static void main(String[] args){}
-
- public static float CentimetersToInches(float centimeters){
- if(centimeters >= 0){
- return centimeters / 2.54f;}
- else {return 0;}
-
- }
-
- public static float InchesToCentimeters(float inches){
- if(inches >= 0){
- return inches * 2.54f;}
- else {return 0;}
- }
-
- public static float FeetToMeters(float feet){
- if(feet >= 0){
- return feet * .3048f;}
- else {return 0;}
- }
-
- public static float MetersToFeet(float meters){
- if(meters >= 0){
- return meters * 3.28084f;}
- else {return 0;}
- }
-
- public static float CelsiusToFahrenheit(float celsius){
- return celsius * 9/5 + 32;
- }
-
- public static float FahrenheitToCelsius(float fahrenheit){
- return (fahrenheit - 32) * 5/9;
- }
-
- public static float MphToKph(float mph){
- if(mph >= 0){
- return mph * 1.609344f;}
- else {return 0;}
- }
-
- public static float KphToMph(float kph){
- if(kph >= 0){
- return kph / 1.609344f;}
- else {return 0;}
- }
- }
|