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