From 0229c16365e5d849857b30ef6bd6634f89913a4b Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Thu, 20 Nov 2014 18:39:54 +0100 Subject: Assignment No.8 implemented non recursive FaB --- .../in/inf/java1/aufgabe8/LottoZiehungMain.java | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/de/fhswf/in/inf/java1/aufgabe8/LottoZiehungMain.java (limited to 'src/de/fhswf/in/inf/java1/aufgabe8/LottoZiehungMain.java') diff --git a/src/de/fhswf/in/inf/java1/aufgabe8/LottoZiehungMain.java b/src/de/fhswf/in/inf/java1/aufgabe8/LottoZiehungMain.java new file mode 100644 index 0000000..6524a29 --- /dev/null +++ b/src/de/fhswf/in/inf/java1/aufgabe8/LottoZiehungMain.java @@ -0,0 +1,51 @@ +/** + * + */ +package de.fhswf.in.inf.java1.aufgabe8; + +import java.util.ArrayList; +import java.util.List; + +/** + * Main class for the LottoZiehung. + * + * @author $Author: $ + * @version $Revision: $, $Date: $ UTC + */ +public final class LottoZiehungMain +{ + + /** + * Private constructor for utility class. + * + */ + private LottoZiehungMain() + { + } + + /** + * Main function of the package. + * + * @param args + * Command line arguments. + */ + public static void main(String[] args) + { + List lottoZahlen = new ArrayList<>(49); + + for (int i = 1; i <= 49; i++) + { + lottoZahlen.add(i); + } + + List ziehung = FloydAndBentley.sample(lottoZahlen, 7); + + Integer Sonderzahl = ziehung.get(6); + + ziehung.remove(6); + + ziehung.sort(null); + + System.out.println(ziehung + " SonderZahl: " + Sonderzahl); + } +} -- cgit v1.2.3-70-g09d2