main

by Bianca on March 19th, 2012
No notes
Syntax: No syntax
Show lines - Hide lines - Show in textbox - Download
#include <iostream>
using namespace std;
#include "Patenschaften.h"
 
 
 
 
int main()
{
 
    char Eingabe1[100];
    char Eingabe2[100];
    char Eingabe3[100];
 
    ifstream datei1;
    datei1.open("personen.txt");
    ladePersonen(datei1);
 
    ifstream datei2;
    datei2.open("beziehungen.txt");
    ladeBeziehungen(datei2);
 
    for (;;)
        {
        cout << "W?hlen Sie eine Aktivit?t:" << endl;
        cout << " i - Suche nach Person" << endl;
        cout << " * - Programm beenden" << endl;
        cin >> Eingabe1;
        cout << endl << endl;
        switch(Eingabe1[0])
           {
 
        case 'i':
            cout << "Wählen Sie:" << endl;
            cout << " a - Suche per Identifikation " << endl;
            cout << " b - Suche per Name" << endl;
            cin >> Eingabe2;
            switch(Eingabe2[0])
                    {
            case 'a':
                cout << "Nach Welcher Person suchen Sie? Bitte geben Sie die ID ein" << endl;
                cin >> Eingabe3;
                cout << endl << endl;
                sucheBeziehung (suchePerson(Eingabe3));
                break;
            case 'b':
                cout << "Nach Welcher Person suchen Sie? Bitte geben Sie den Namen ein" << endl;
                cin >> Eingabe3;
                cout << endl << endl;
                sucheNamen (Eingabe3);
                break;
            default:
               cout << "Das Kommando " << Eingabe2 << " verstehe ich nicht" << endl;
               break;
                     }
            break;
 
        case '*':
           return 0;
 
        default:
           cout << "Das Kommando " << Eingabe1 << " verstehe ich nicht" << endl;
           break;
           }
        }
    datei1.close();
    return 0;
    }
 

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS