12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- public class ConversionTool {
-
- public static void main(String[] args){}
-
- public static float CentimetersToInches(float centimeters){
- if (centimeters < 0) {
- return 0;
- } else {
- return (float) (centimeters * 0.3937);
- }
- }
-
- public static float InchesToCentimeters(float inches){
-
- if (inches < 0) {
- return 0;
- } else {
- return (float) (inches * 2.54);
- }
- }
-
- public static float FeetToMeters(float feet){
- if (feet < 0) {
- return 0;
- } else {
- return (float) (feet * 0.3048);
- }
- }
-
- public static float MetersToFeet(float meters){
- if (meters < 0) {
- return 0;
- } else {
- return (float) (meters * 3.28084);
- }
- }
-
- 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 0;
- } else {
- return (float) (mph * 1.609344);
- }
- }
-
- public static float KphToMph(float kph){
- if (kph < 0) {
- return 0;
- } else {
- return (float) (kph * 0.6213711922);
- }
- }
- }
|