diff --git a/Uebung 1/Sortiment.cpp b/Uebung 1/Sortiment.cpp index c78282a..1f7ce57 100644 --- a/Uebung 1/Sortiment.cpp +++ b/Uebung 1/Sortiment.cpp @@ -1,4 +1,6 @@ #include "Sortiment.h" +#include "Algorithms.h" +#include void Sortiment::addWare(Ware *ware) { for (int i = 0; i < 10; i++) { @@ -6,4 +8,22 @@ void Sortiment::addWare(Ware *ware) { this->waren[i] = ware; } } +} + +void Sortiment::sort(int modus) { + switch (modus) { + case 1: + break; + case 2: + bubbleSort(this->waren); + break; + case 3: + break; + case 4: + break; + case 5: + break; + default: + std::cout << "Wrong Mode!" << std::endl; + } } \ No newline at end of file diff --git a/Uebung 1/Sortiment.h b/Uebung 1/Sortiment.h index ce3213c..4f6e622 100644 --- a/Uebung 1/Sortiment.h +++ b/Uebung 1/Sortiment.h @@ -9,8 +9,9 @@ private: public: void addWare(Ware *ware); Sortiment() { - for (int i = 0; i < 10;) { + for (int i = 0; i < 10; i++) { waren[i] = nullptr; } } + void sort(int modus); }; \ No newline at end of file