Skip to content

Instantly share code, notes, and snippets.

@kelteseth
Created September 22, 2011 16:08
Show Gist options
  • Save kelteseth/1235180 to your computer and use it in GitHub Desktop.
Save kelteseth/1235180 to your computer and use it in GitHub Desktop.
programm
import java.util.Scanner;
public class Reichweitenrechner {
public static void main(String[]args)
{
Scanner sc = new Scanner(System.in);
System.out.println("--------------------------Reichweitenrechner-------------------");
System.out.println("ver. 0.1");
System.out.println();
double fahrtStrecke ;
double verbrauch100 ;
double kraftstoffMenge ;
;
System.out.print("Bitte Verbrauch in Liter/100km eingeben!");
verbrauch100 = sc.nextDouble();
System.out.println();
System.out.println("Geben sie nun ihre verbleibende Kraftstoffmenge in Liter an!");
kraftstoffMenge = sc.nextDouble();
System.out.println();
System.out.println();
fahrtStrecke = kraftstoffMenge / verbrauch100;
System.out.println("Ihre verbleibende Fahrtstrecke beträgt: " + (fahrtStrecke*100)+ " km");
System.out.println();
System.out.println();
System.out.println("---------------------------------------------------------------");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment