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