1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
|
public static void main(String[] args) {
double celsius;
String pattern="###,##0.00";
DecimalFormat form = new DecimalFormat(pattern);
Scanner scan = new Scanner(System.in);
System.out.print("Geben Sie den Minimalwert ein: ");
int fahrenheit = scan.nextInt();
System.out.println("Geben Sie den Maximalwert ein: ");
int max = scan.nextInt();
System.out.println("Geben Sie die Schrittweite an: ");
int a = scan.nextInt();
scan.close();
while (fahrenheit <= max)
{
celsius = ( 5 / 9f) * ( fahrenheit -32 );
System.out.print(fahrenheit+"F\t");
System.out.println(form.format(celsius)+"C");
fahrenheit += a;
}
} |