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