Skip to content
Snippets Groups Projects
RefactoringDemo.cpp 961 B
Newer Older
  • Learn to ignore specific revisions
  • #include <iostream>
    #include <string>
    using namespace std;
    
    /* Include Dummy Code to make demo compile */
    /* Ignore for refactoring demo! */
    #include "DummyCode.cpp"
    /* End of code to be ignored */
    
    void pruefeRezepte(VorhandeneZutaten VZ){
        int i, j, k;
        bool da;
        for (i=0; i<getAnzahlRezepte(); i++){
            Rezept* r = getRezept(i);
            cout << i << ". " << r->getRezeptName() << ": ";
            da=true;
            for (j = 0; j < r->getAnzahlRezeptZutaten(); j++) {
                string z = r->getZutat(j);
                bool OK= false;
                for (k=0; k<VZ.getAnzahlZutaten();k++){
                    if (z==VZ.getVorhandeneZutat(k)){
                        OK= true;
                        break;
                    }
                }
                if (OK== false) {
                    da = false;
                    break;
                }
            }
            if (da == true) {
                cout << " mischbar\n"; }
            else {	cout << " nicht mischbar!\n"; }
        }
    }