mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 19:36:26 +02:00
ID-5: Aufgabe 2 bearbeitet
This commit is contained in:
10
id/blatt5/code/wam/Umrechner.java
Normal file
10
id/blatt5/code/wam/Umrechner.java
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
public class Umrechner {
|
||||
public int convertToCelsius(int fahrenheit) {
|
||||
return Math.round(5.0f / 9.0f * (fahrenheit - 32));
|
||||
}
|
||||
|
||||
public int convertToFahrenheit(int celsius) {
|
||||
return Math.round(1.8f * celsius + 32);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user