16 lines
492 B
Plaintext
16 lines
492 B
Plaintext
import java.util.Scanner;
|
|
public class Kraftstoffverbrauch {
|
|
public static void main(String args[]) {
|
|
Scanner input = new Scanner(System.in);
|
|
double gefahreneKm = 55.0;
|
|
double kraftstoffmenge = 5.0;
|
|
System.out.print("KM: ");
|
|
if(input.hasNextDouble()) {
|
|
gefahreneKm = input.nextDouble();
|
|
}
|
|
if(input.hasNextDouble()) {
|
|
gefahreneKm = input.nextDouble();
|
|
}
|
|
System.out.println("Kraftstoffverbrauch: " + ((kraftstoffmenge/gefahreneKm)*100));
|
|
}
|
|
} |