123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- public class ConversionTool {
-
-
- public static void main(String[] args){
- }
-
- public static float CentimetersToInches(float centimeters){
- float output;
- if(centimeters<0)
- {
- output=0;
- }
- else
- {
- output =(float)0.39370*centimeters;
- }
- return output;
- }
-
- public static float InchesToCentimeters(float inches){
- float output;
- if(inches<0)
- {
- output=0;
- }
- else
- {
- output =inches/(float)0.39370;
- }
- return output;
- }
-
- public static float FeetToMeters(float feet)
- {
- float output;
- if(feet<0)
- {
- output=0;
- }
- else
- {
- output =feet*(float)(1/3.28);
- }
- return output;
-
- }
-
- public static float MetersToFeet(float meters)
- {
- float output;
- if(meters<0)
- {
- output=0;
- }
- else
- {
- output =meters*(float)(3.28084);
- }
- return output;
- }
-
- public static float CelsiusToFahrenheit(float celsius)
- {
- return (float)(celsius*1.8)+32;
- }
-
- public static float FahrenheitToCelsius(float fahrenheit)
- {
- return (float)((fahrenheit-32)/1.8);
- }
-
- public static float MphToKph(float mph)
- {
- // return (float)(1.609344*mph);
- float output;
- if(mph<0)
- {
- output=0;
- }
- else
- {
- output =(float)(mph*1.609344);
- }
- return output;
- }
-
- public static float KphToMph(float kph)
- {
- float output;
- if(kph<0)
- {
- output=0;
- }
- else
- {
- output =(float)(kph*0.6213711922);
- }
- return output;
- }
- }
|