backup
This commit is contained in:
17
2/Eingabe/Kraftstoffverbrauch.java
Normal file
17
2/Eingabe/Kraftstoffverbrauch.java
Normal file
@@ -0,0 +1,17 @@
|
||||
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();
|
||||
}
|
||||
System.out.print("kraftstoffmenge: ");
|
||||
if(input.hasNextDouble()) {
|
||||
kraftstoffmenge = input.nextDouble();
|
||||
}
|
||||
System.out.println("Kraftstoffverbrauch: " + ((kraftstoffmenge/gefahreneKm)*100));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user