Add Console Input
This commit is contained in:
parent
0dbcbc0b64
commit
5277ba3836
@ -5,8 +5,20 @@ import java.io.FileWriter;
|
|||||||
|
|
||||||
public class Anwendung {
|
public class Anwendung {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
int startingNR = 420000;
|
int startingNR = 0;
|
||||||
int amountOfSets = 15;
|
int amountOfSets = 0;
|
||||||
|
Console_Input reader = new Console_Input();
|
||||||
|
String input;
|
||||||
|
|
||||||
|
while (!(startingNR<1_000_000 && startingNR>99_999)) {
|
||||||
|
input = reader.getInput("enter a valid customer ID (6 Digit Integer)");
|
||||||
|
startingNR = Integer.parseInt(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!(amountOfSets>0 && amountOfSets<1000)) {
|
||||||
|
input = reader.getInput("How many data Sets do you want? (1-999)");
|
||||||
|
amountOfSets = Integer.parseInt(input);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FileWriter out1 = new FileWriter("C:\\Users\\dh10mbo\\OneDrive - Durr Group\\Documents\\Uni\\S2\\Repos\\S2_Aufgaben\\src\\part2\\aufg1\\output_files\\spacedOut.txt");
|
FileWriter out1 = new FileWriter("C:\\Users\\dh10mbo\\OneDrive - Durr Group\\Documents\\Uni\\S2\\Repos\\S2_Aufgaben\\src\\part2\\aufg1\\output_files\\spacedOut.txt");
|
||||||
|
24
src/part2/aufg1/Console_Input.java
Normal file
24
src/part2/aufg1/Console_Input.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package part2.aufg1;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
public class Console_Input {
|
||||||
|
|
||||||
|
public String getInput(String prompt) {
|
||||||
|
String input = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
|
||||||
|
System.out.println(prompt);
|
||||||
|
input = reader.readLine();
|
||||||
|
System.out.print("The following input was read: ");
|
||||||
|
System.out.println(input);
|
||||||
|
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,42 @@
|
|||||||
420015#Susanne#Novincack#Ulmer Str.#73#70192 Stuttgart#1771.0
|
864042#Marion#Ullmann#Schillerstr.#59#72213 Altensteig#1997.0
|
||||||
420016#Ingo#Ullmann#Dorfstr.#27#70197 Stuttgart#875.0
|
864043#Stefan#Hampel#Freiburger Str.#97#72213 Altensteig#1601.0
|
||||||
420017#Marion#Kaiser#Ulmer Str.#3#72074 T<>bingen#976.0
|
864044#Marion#Fuchs#Goetheweg#86#70327 Stuttgart#554.0
|
||||||
420018#Jochen#Zerlett#Rosenweg#19#70191 Stuttgart#1591.0
|
864045#Marion#Ullmann#Goetheweg#75#70195 Stuttgart#1838.0
|
||||||
420019#Marion#Zerlett#Nelkenweg#63#70199 Stuttgart#1429.0
|
864046#Stefan#Ullmann#Schillerstr.#81#72181 Starzach#1320.0
|
||||||
420020#Holger#Fuchs#Hauptstr.#71#72182 Eutingen#1239.0
|
864047#Susanne#Andrack#Rosenweg#42#72185 Empfingen#1021.0
|
||||||
420021#Uschi#Fuchs#Rosenweg#131#70195 Stuttgart#1299.0
|
864048#Frank#Hellmann#Stuttgarter Str.#109#72185 Empfingen#554.0
|
||||||
420022#Steffi#Andrack#Freiburger Str.#76#72182 Eutingen#1937.0
|
864049#Stefan#Zerlett#Stuttgarter Str.#48#70197 Stuttgart#1055.0
|
||||||
420023#Steffi#Kaiser#Hauptstr.#103#70193 Stuttgart#669.0
|
864050#Susanne#Mayer#Rosenweg#110#72210 Altensteig#1906.0
|
||||||
420024#Steffi#Andrack#Beethovenallee#117#72213 Altensteig#1684.0
|
864051#Stefan#Schmidt#Mönchner Str.#89#72076 T<>bingen#1974.0
|
||||||
420025#Jochen#Hellmann#Stuttgarter Str.#125#72181 Starzach#1747.0
|
864052#Jochen#Novincack#Mönchner Str.#109#72184 Eutingen#1277.0
|
||||||
420026#Jochen#Schmidt#Beethovenallee#5#72210 Altensteig#796.0
|
864053#Uschi#Zerlett#Dorfstr.#3#72186 Weiherhof#649.0
|
||||||
420027#Steffi#Kaiser#Mönchner Str.#35#72070 T<>bingen#1052.0
|
864054#Carola#Ullmann#Freiburger Str.#69#72072 T<>bingen#1299.0
|
||||||
420028#Uschi#Hinz#Beethovenallee#145#72189 V<>hringen#964.0
|
864055#Stefan#Kaiser#Schillerstr.#27#72072 T<>bingen#1325.0
|
||||||
420029#Susanne#Hellmann#Mönchner Str.#64#72186 Weiherhof#1128.0
|
864056#Jochen#Andrack#Hauptstr.#37#72184 Eutingen#720.0
|
||||||
|
864057#Holger#Hinz#Mönchner Str.#88#70179 Stuttgart#621.0
|
||||||
|
864058#Ingo#Mayer#Freiburger Str.#40#72074 T<>bingen#989.0
|
||||||
|
864059#Uschi#Meier#Beethovenallee#141#72160 Horb#680.0
|
||||||
|
864060#Marion#Novincack#Mönchner Str.#35#72070 T<>bingen#1284.0
|
||||||
|
864061#Stefan#Andrack#Beethovenallee#28#72076 T<>bingen#1537.0
|
||||||
|
864062#Steffi#Fuchs#Stuttgarter Str.#17#72210 Altensteig#1661.0
|
||||||
|
864063#Holger#Ullmann#Dorfstr.#68#72184 Eutingen#895.0
|
||||||
|
864064#Carola#Mayer#Ulmer Str.#86#72076 T<>bingen#1218.0
|
||||||
|
864065#Susanne#Hinz#Schillerstr.#13#72181 Starzach#980.0
|
||||||
|
864066#Susanne#Schmidt#Mönchner Str.#43#70197 Stuttgart#1378.0
|
||||||
|
864067#Frank#Mayer#Stuttgarter Str.#98#70195 Stuttgart#1874.0
|
||||||
|
864068#Ingo#Hellmann#Goetheweg#4#72186 Empfingen#1059.0
|
||||||
|
864069#Uschi#Hinz#Schillerstr.#102#70193 Stuttgart#1016.0
|
||||||
|
864070#Ingo#Hampel#Ulmer Str.#111#72184 Eutingen#1600.0
|
||||||
|
864071#Jochen#Zerlett#Beethovenallee#65#72184 Eutingen#1064.0
|
||||||
|
864072#Jochen#Fuchs#Freiburger Str.#133#72213 Altensteig#846.0
|
||||||
|
864073#Ingo#Schmidt#Freiburger Str.#62#72185 Empfingen#1996.0
|
||||||
|
864074#Uschi#Schmidt#Ulmer Str.#59#70197 Stuttgart#1977.0
|
||||||
|
864075#Steffi#Fuchs#Freiburger Str.#6#72202 Nagold#698.0
|
||||||
|
864076#Ingo#Hampel#Nelkenweg#98#72187 V<>hringen#564.0
|
||||||
|
864077#Stefan#Schmidt#Mönchner Str.#13#70327 Stuttgart#1019.0
|
||||||
|
864078#Marion#Hinz#Mönchner Str.#42#72181 Starzach#758.0
|
||||||
|
864079#Stefan#Andrack#Nelkenweg#41#72181 Starzach#637.0
|
||||||
|
864080#Stefan#Fuchs#Schillerstr.#92#70197 Stuttgart#1787.0
|
||||||
|
864081#Marion#Fuchs#Stuttgarter Str.#25#72185 Empfingen#1324.0
|
||||||
|
864082#Marion#Kaiser#Stuttgarter Str.#46#70192 Stuttgart#937.0
|
||||||
|
864083#Carola#Mayer#Mönchner Str.#64#70199 Stuttgart#953.0
|
||||||
|
@ -1,15 +1,42 @@
|
|||||||
420000 Jochen Kaiser Rosenweg 134 72184 Eutingen 1809.0
|
864000 Susanne Ullmann Goetheweg 43 72074 T<>bingen 976.0
|
||||||
420001 Jochen Kaiser Freiburger Str. 118 70199 Stuttgart 1321.0
|
864001 Uschi Zerlett Nelkenweg 16 70179 Stuttgart 1084.0
|
||||||
420002 Carola Hampel Freiburger Str. 18 72184 Eutingen 1434.0
|
864002 Susanne Hampel Stuttgarter Str. 137 72072 T<>bingen 510.0
|
||||||
420003 Carola Ullmann Goetheweg 52 72187 V<>hringen 1212.0
|
864003 Susanne Fuchs Schillerstr. 87 72213 Altensteig 842.0
|
||||||
420004 Uschi Meier Schillerstr. 128 70195 Stuttgart 1902.0
|
864004 Uschi Kaiser Stuttgarter Str. 127 70195 Stuttgart 648.0
|
||||||
420005 Frank Zerlett Beethovenallee 126 72184 Eutingen 1011.0
|
864005 Ingo Hellmann Goetheweg 150 70193 Stuttgart 1491.0
|
||||||
420006 Jochen Hampel Dorfstr. 12 72189 V<>hringen 572.0
|
864006 Uschi Novincack Nelkenweg 95 72074 T<>bingen 617.0
|
||||||
420007 Stefan Ullmann Mönchner Str. 3 72218 Wildberg 1346.0
|
864007 Frank Hampel Mönchner Str. 39 72074 T<>bingen 1486.0
|
||||||
420008 Jochen Hellmann Schillerstr. 123 70193 Stuttgart 1497.0
|
864008 Carola Kaiser Mönchner Str. 27 72074 T<>bingen 932.0
|
||||||
420009 Uschi Hellmann Freiburger Str. 43 72070 T<>bingen 1500.0
|
864009 Steffi Mayer Freiburger Str. 140 72186 Weiherhof 1046.0
|
||||||
420010 Uschi Hampel Hauptstr. 117 70195 Stuttgart 781.0
|
864010 Carola Ullmann Nelkenweg 142 72181 Starzach 833.0
|
||||||
420011 Susanne Kaiser Ulmer Str. 3 70195 Stuttgart 1448.0
|
864011 Frank Hampel Ulmer Str. 139 70193 Stuttgart 1644.0
|
||||||
420012 Jochen Kaiser Dorfstr. 95 70192 Stuttgart 1876.0
|
864012 Marion Novincack Freiburger Str. 56 72072 T<>bingen 1347.0
|
||||||
420013 Ingo Zerlett Rosenweg 96 70197 Stuttgart 636.0
|
864013 Marion Mayer Schillerstr. 38 72213 Altensteig 803.0
|
||||||
420014 Frank Hellmann Dorfstr. 127 70195 Stuttgart 1800.0
|
864014 Frank Schmidt Mönchner Str. 127 72184 Eutingen 1236.0
|
||||||
|
864015 Marion Meier Freiburger Str. 58 70191 Stuttgart 1043.0
|
||||||
|
864016 Steffi Hellmann Rosenweg 81 70193 Stuttgart 1768.0
|
||||||
|
864017 Frank Andrack Dorfstr. 81 70191 Stuttgart 1555.0
|
||||||
|
864018 Holger Novincack Rosenweg 121 72202 Nagold 1311.0
|
||||||
|
864019 Stefan Mayer Dorfstr. 20 70327 Stuttgart 603.0
|
||||||
|
864020 Stefan Fuchs Freiburger Str. 98 70199 Stuttgart 799.0
|
||||||
|
864021 Marion Hinz Freiburger Str. 102 72210 Altensteig 1141.0
|
||||||
|
864022 Holger Fuchs Mönchner Str. 100 72186 Weiherhof 984.0
|
||||||
|
864023 Stefan Kaiser Hauptstr. 95 72076 T<>bingen 1898.0
|
||||||
|
864024 Ingo Hellmann Nelkenweg 78 72202 Nagold 1486.0
|
||||||
|
864025 Jochen Ullmann Goetheweg 100 72182 Eutingen 1681.0
|
||||||
|
864026 Susanne Andrack Stuttgarter Str. 71 70199 Stuttgart 647.0
|
||||||
|
864027 Marion Andrack Goetheweg 17 70193 Stuttgart 789.0
|
||||||
|
864028 Uschi Mayer Dorfstr. 148 72210 Altensteig 604.0
|
||||||
|
864029 Holger Hampel Goetheweg 134 70191 Stuttgart 1655.0
|
||||||
|
864030 Jochen Ullmann Mönchner Str. 42 72210 Altensteig 1867.0
|
||||||
|
864031 Uschi Hampel Stuttgarter Str. 91 72184 Eutingen 1787.0
|
||||||
|
864032 Stefan Ullmann Schillerstr. 100 72202 Nagold 657.0
|
||||||
|
864033 Steffi Fuchs Freiburger Str. 108 72160 Horb 522.0
|
||||||
|
864034 Stefan Ullmann Beethovenallee 100 72160 Horb 1418.0
|
||||||
|
864035 Carola Fuchs Hauptstr. 38 70197 Stuttgart 587.0
|
||||||
|
864036 Ingo Kaiser Hauptstr. 35 72210 Altensteig 1492.0
|
||||||
|
864037 Uschi Kaiser Freiburger Str. 82 72076 T<>bingen 1960.0
|
||||||
|
864038 Carola Novincack Stuttgarter Str. 143 72210 Altensteig 1684.0
|
||||||
|
864039 Steffi Mayer Freiburger Str. 26 72202 Nagold 1230.0
|
||||||
|
864040 Susanne Mayer Hauptstr. 122 70193 Stuttgart 575.0
|
||||||
|
864041 Stefan Hellmann Dorfstr. 60 70193 Stuttgart 1228.0
|
||||||
|
Loading…
Reference in New Issue
Block a user