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