Fehlermeldung bei Klassen



  • Hallo zusammen,

    ich muss ein Programm zur Aktienverwaltunge schreiben. Hab dabei jetzt eine Klasse erstellt mit dem Namen Aktiendepot und verschiedene Methoden. Eine Methode z.B heißt Kauforder_Audi. Wenn ich diese Methode definieren will, muss ich ja schreiben Aktiendepot::Kauforder_Audi.
    Hab ich das dann gemacht erscheint aber immer diese Fehlermeldung:
    [C++ Error] depot1.cpp(39): E2316 'Aktiendepot::Kauforder_Audi(float,float,float)' is not a member of 'Aktiendepot'

    Kann mir hier vielleicht jemand weiterhelfen, wie ich diese Problem lösen kann.

    Danke
    Bluebird



  • hallo,

    hau mal deine komplette klassendeklaration rein...

    mfg
    murph



  • Das ist die gesamte Klasse

    #include <iostream.h>
    
    class Aktiendepot
    {
            private:
            int Aktiendepotnummer(int);
            int Wertpapiernummer(int);
            void Tageskurs (float);
            float Aktienanteile (float);
    
            public:
            float Kauforder_Audi (float AKauf);
            float Kauforder_BMW (float BKauf);
            float Kauforder_Nike (float NKauf);
            float Kauforder_Puma (float PKauf);
            float Verkauforder_Audi (float AVerkauf);
            float Verkauforder_BMW (float BVerkauf);
            float Verkauforder_Nike (float NVerkauf);
            float Verkauforder_Puma (float PVerkauf);
            float aktueller_Stand_Audi (float AStand);
            float aktueller_Stand_BMW (float BStand);
            float aktueller_Stand_Nike (float NStand);
            float aktueller_Stand_Puma (float PStand);
            float Tageskurs_pflegen_Audi(float AKurs);
            float Tageskurs_pflegen_BMW(float BKurs);
            float Tageskurs_pflegen_Nike(float NKurs);
            float Tageskurs_pflegen_Puma(float PKurs);
            Aktiendepot();
            ~Aktiendepot();
    
    };
    
    Aktiendepot::Aktiendepot()
    {
            cout<<"Das Depot wurde angelegt!!"<<endl;
    }
    
    float Aktiendepot::Kauforder_Audi (float AKauf, float AKP, float AKurs)
    {
            AKP=AKauf * AKurs;
            return (AKP);
    }
    
    float Aktiendepot::Kauforder_BMW (float BKauf, float BKP, float BKurs)
    {
            BKP=BKauf * BKurs;
            return (BKP);
    }
    
    float Aktiendepot::Kauforder_Nike (float NKauf, float NKP, float NKurs)
    {
            NKP=NKauf * NKurs;
            return (NKP);
    }
    
    float Aktiendepot::Kauforder_Puma (float PKauf, float PKP, float PKurs)
    {
            PKP=PKauf * PKurs;
            return (PKP);
    }
    
    float Aktiendepot::Verkauforder_Audi (float AVerkauf, float AVP, float AKurs)
    {
    
            AVP=AVerkauf * AKurs;
            return (AVP);
    
    }
    
    float Aktiendepot::Verkauforder_BMW (float BVerkauf, float BVP, float BKurs)
    {
    
            BVP=BVerkauf * BKurs;
            return (BVP);
    
    }
    
    float Aktiendepot::Verkauforder_Nike (float NVerkauf, float NVP, float NKurs)
    {
    
            NVP=NVerkauf * NKurs;
            return (NVP);
    
    }
    
    float Aktiendepot::Verkauforder_Puma (float PVerkauf, float PVP, float PKurs)
    {
    
            PVP=PVerkauf * PKurs;
            return (PVP);
    
    }
    
    float Aktiendepot::aktueller_Stand_Audi (float AStand, float AKauf, float AVerkauf, float AKurs, int AStueck)
    {
            AStueck = AKauf-AVerkauf;
            AStand = AStueck*AKurs;
            return (AStand);
    
    }
    
    float Aktiendepot::aktueller_Stand_BMW (float BStand, float BKauf, float BVerkauf, float BKurs, int BStueck)
    {
            BStueck = BKauf-BVerkauf;
            BStand = BStueck*BKurs;
            return (BStand);
    }
    
    float Aktiendepot::aktueller_Stand_Nike (float NStand, float NKauf, float NVerkauf, float NKurs, int NStueck)
    {
            NStueck = NKauf-NVerkauf;
            NStand = NStueck*NKurs;
            return (NStand);
    }
    
    float Aktiendepot::aktueller_Stand_Puma (float PStand, float PKauf, float PVerkauf, float PKurs, int PStueck)
    {
            PStueck = PKauf-PVerkauf;
            PStand = PStueck*PKurs;
            return (PStand);
    }
    
    float Aktiendepot::Tageskurs_pflegen_Audi (float AKurs, float ATageskurs)
    {
            ATageskurs = AKurs;
            return (AKurs);
    }
    
    float Aktiendepot::Aktiendepot::Tageskurs_pflegen_BMW (float BKurs, float BTageskurs)
    {
            BTageskurs = BKurs;
            return (BKurs);
    }
    
    float Aktiendepot::Tageskurs_pflegen_Nike (float NKurs, float NTageskurs)
    {
            NTageskurs = NKurs;
            return (NKurs);
    }
    
    float Aktiendepot::Tageskurs_pflegen_Puma (float PKurs, float PTageskurs)
    {
            PTageskurs = PKurs;
            return (PKurs);
    }
    
    Aktiendepot::~Aktiendepot();
    {
            cout<<"Das Depot wurde aufgelöst"<<endl;
            cout<<"Der Wert beträgt:";
            cout<< stand << endl;
    }
    

    Edit:
    Bitte die Code-Tags benutzen. Danke!

    [ Dieser Beitrag wurde am 03.06.2003 um 21:32 Uhr von Jansen editiert. ]



  • In der Deklaration haben die Funktionen nur einen Parameter, bei der Implementierung auf einmal drei. Da kann doch was nich stimmen, oder? 😉

    Verschoben nach "C++".


Anmelden zum Antworten