Skip to content

Instantly share code, notes, and snippets.

package haus;
public class Haus {
public static boolean inRechteck(double px, double py, double olx, double oly, double urx, double ury) {
return (px <= urx) && (py <= ury) && (px >= olx) && (py >= oly);
}
public static boolean inRaute(double px, double py, double cx, double cy, double b) {
return (Math.abs(px-cx)+Math.abs(py-cy))<=b;
}
@notdukebutduc
notdukebutduc / gist:ecc4b0c3ca68ea594f87
Created November 7, 2015 16:11
arithmetisches mittel
package helloworld;
public class Durchschnitt {
public static void main(String[] args) {
// TODO Auto-generated method stub
int gesamtmenge = 0;
while (gesamtmenge < 1){
System.out.println("Bitte geben Sie die Anzahl der Werte an , fuer die sie das arithmethische Mittel berechnen wollen:");
gesamtmenge = Integer.parseInt(System.console().readLine());