Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion conversion.iml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand All @@ -13,5 +13,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
</module>
70 changes: 55 additions & 15 deletions src/main/java/ConversionTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,59 @@ public class ConversionTool {

public static void main(String[] args){}

public static float CentimetersToInches(float centimeters){}

public static float InchesToCentimeters(float inches){}

public static float FeetToMeters(float feet){}

public static float MetersToFeet(float meters){}

public static float CelsiusToFahrenheit(float celsius){}

public static float FahrenheitToCelsius(float fahrenheit){}

public static float MphToKph(float mph){}

public static float KphToMph(float kph){}
public static float CentimetersToInches(float centimeters){
if (centimeters < 0){
return 0;
}else {
return (float) (centimeters * 0.393701);
}
}

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 (float)((celsius * (9.0/5.0)) + 32);
}

public static float FahrenheitToCelsius(float fahrenheit){
return (float) ((fahrenheit - 32) * (5.0/9.0));
}

public static float MphToKph(float mph){
if (mph < 0){
return 0;
}else {
return (float) (mph * 1.60934);
}
}

public static float KphToMph(float kph){
if (kph < 0){
return 0;
}else {
return (float) (kph * 0.621371);
}
}
}
Binary file modified target/classes/ConversionTool.class
Binary file not shown.