initial commit
This commit is contained in:
commit
872702dece
|
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
|
|
@ -0,0 +1 @@
|
|||
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points version="2.0" />
|
||||
</component>
|
||||
<component name="ProjectKey">
|
||||
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" default="true" project-jdk-name="13" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/picker.iml" filepath="$PROJECT_DIR$/picker.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package gfn.marc;
|
||||
|
||||
public class Picker {
|
||||
|
||||
// dreidimensionales Array für Simulation des Lagers
|
||||
static int[][][] lager = new int[4][3][12];
|
||||
|
||||
// Arrays "liste" und "fehler", wie in Aufgabe
|
||||
static int[][] liste = new int[4][4];
|
||||
static int[][] fehler = new int[4][4];
|
||||
|
||||
static int zeileF = 0;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// lager-Array füllen
|
||||
lager[0][0][0] = 434;
|
||||
lager[0][0][3] = 434;
|
||||
lager[2][2][11] = 189;
|
||||
lager[3][1][7] = 202; // FEHLER: hier sollte eigentlich Ware_ID 201 liegen
|
||||
|
||||
// liste-Array füllen
|
||||
liste[0][0] = 434;
|
||||
liste[0][1] = 1;
|
||||
liste[0][2] = 1;
|
||||
liste[0][3] = 1;
|
||||
liste[1][0] = 434;
|
||||
liste[1][1] = 1;
|
||||
liste[1][2] = 1;
|
||||
liste[1][3] = 4;
|
||||
liste[2][0] = 189;
|
||||
liste[2][1] = 3;
|
||||
liste[2][2] = 3;
|
||||
liste[2][3] = 12;
|
||||
liste[3][0] = 201;
|
||||
liste[3][1] = 4;
|
||||
liste[3][2] = 2;
|
||||
liste[3][3] = 8;
|
||||
|
||||
// Warenliste abarbeiten
|
||||
entnehmeWaren(liste);
|
||||
|
||||
// Fehlerliste ausgeben
|
||||
System.out.println("\nFolgende Waren sind falsch eingelagert: ");
|
||||
for (int i = 0; i < fehler.length; i++) {
|
||||
if (fehler[i][1] != 0) {
|
||||
System.out.println("---------------------------");
|
||||
System.out.println("Ware-ID: " + fehler[i][0]);
|
||||
System.out.println("Regal: " + fehler[i][1]);
|
||||
System.out.println("Ebene: " + fehler[i][2]);
|
||||
System.out.println("Fach: " + fehler[i][3]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void entnehmeWaren(int[][] liste) {
|
||||
for (int i = 0; i < liste.length; i++) {
|
||||
int regalNr = liste[i][1];
|
||||
int ebeneNr = liste[i][2];
|
||||
int fachNr = liste[i][3];
|
||||
|
||||
System.out.println("---------------------------");
|
||||
fahreRegalAn(regalNr);
|
||||
fahreEbeneAn(ebeneNr);
|
||||
fahreFachAn(fachNr);
|
||||
|
||||
if (pruefeWare(lager[regalNr - 1][ebeneNr - 1][fachNr - 1], i)) {
|
||||
entnehmeWare(regalNr, ebeneNr, fachNr);
|
||||
} else {
|
||||
System.out.println("Falsche Ware-ID!");
|
||||
kopiereZeile(liste, fehler, i, zeileF);
|
||||
zeileF++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void fahreRegalAn(int regalNr) {
|
||||
System.out.println("Picker fährt Regal " + regalNr + " an.");
|
||||
}
|
||||
|
||||
static void fahreEbeneAn(int ebeneNr) {
|
||||
System.out.println("Picker fährt Ebene " + ebeneNr + " an.");
|
||||
}
|
||||
|
||||
static void fahreFachAn(int fachNr) {
|
||||
System.out.println("Picker fährt Fach " + fachNr + " an.");
|
||||
}
|
||||
|
||||
static boolean pruefeWare(int ware_id, int zeileL) { // Hier musste ich zusätzlich die Zeile der Liste übergeben
|
||||
return ware_id == liste[zeileL][0];
|
||||
}
|
||||
|
||||
static void entnehmeWare(int regalNr, int ebeneNr, int fachNr) {
|
||||
System.out.println("Ware " + lager[regalNr - 1][ebeneNr - 1][fachNr - 1] + " entnommen.");
|
||||
lager[regalNr - 1][ebeneNr - 1][fachNr - 1] = 0;
|
||||
}
|
||||
|
||||
static void kopiereZeile(int[][] liste, int[][] fehler, int zeileL, int zeileF) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
fehler[zeileF][i] = liste[zeileL][i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue