Created
November 8, 2010 18:33
-
-
Save ofhouse/668047 to your computer and use it in GitHub Desktop.
Kontoverwaltung mit Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include "Kunde.h" | |
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
CKunde objKunde("Schulze"); | |
int nr; | |
float betrag; | |
char weiter; | |
CKonto* tmp; | |
list<CKonto*> test; | |
while(1) | |
{ | |
cout<<"Kontonummer :"<<endl; | |
cin>>nr; | |
cout<<"Betrag: "<<endl; | |
cin>>betrag; | |
tmp=new CKonto(betrag,nr); | |
objKunde.einfuegenKonto(tmp); | |
cout<<"Weiteres Konto ?"; | |
cin>>weiter; | |
if (weiter=='n') | |
break; | |
} | |
objKunde.ausgabe(); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "StdAfx.h" | |
#include "Konto.h" | |
CKonto::CKonto(void) | |
{ | |
KtoNr=0; | |
KtoStand=0.0f; | |
} | |
CKonto::~CKonto(void) | |
{ | |
} | |
CKonto::CKonto(float ks,int kn) | |
{ | |
KtoNr=kn; | |
KtoStand=ks; | |
} | |
CKonto::CKonto(const CKonto©) | |
{ | |
KtoNr=copy.KtoNr; | |
KtoStand=copy.KtoStand; | |
} | |
int CKonto::getKtoNr() | |
{ | |
return KtoNr; | |
} | |
float CKonto::getKtoStand() | |
{ | |
return KtoStand; | |
} | |
void CKonto::setKtoStand(float ks) | |
{ | |
KtoStand=ks; | |
} | |
void CKonto::setKtoNr(int kn) | |
{ | |
KtoNr=kn; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
class CKonto | |
{ | |
private: | |
int KtoNr; | |
float KtoStand; | |
public: | |
int getKtoNr(); | |
float getKtoStand(); | |
void setKtoStand(float); | |
void setKtoNr(int); | |
CKonto(void); | |
CKonto(float,int); | |
CKonto(const CKonto&); | |
~CKonto(void); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "StdAfx.h" | |
#include "Kunde.h" | |
CKunde::CKunde(void) | |
{ | |
Kunde="Mustermann"; | |
} | |
CKunde::CKunde(string name) | |
{ | |
Kunde=name; | |
} | |
CKunde::~CKunde(void) | |
{ | |
} | |
void CKunde::ausgabe(void) | |
{ | |
list<CKonto*>::const_iterator pos=kontenliste.begin(); | |
for (;pos!=kontenliste.end();++pos) | |
{ | |
cout<<(*pos)->getKtoNr()<<endl<<(*pos)->getKtoStand()<<endl<<endl; | |
} | |
} | |
list<CKonto*> CKunde::getkontenliste () | |
{ | |
return kontenliste; | |
} | |
void CKunde::einfuegenKonto(CKonto* tmp) | |
{ | |
kontenliste.push_back(tmp); | |
} | |
string CKunde::getname() | |
{ | |
return Kunde; | |
} | |
void CKunde::setname(string name) | |
{ | |
Kunde=name; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "Konto.h" | |
class CKunde | |
{ | |
private: | |
string Kunde; | |
list<CKonto*> kontenliste; | |
public: | |
list<CKonto*> getkontenliste(); | |
void einfuegenKonto(CKonto*); | |
string getname(); | |
void setname(string); | |
void ausgabe(void); | |
CKunde(string); | |
CKunde(void); | |
~CKunde(void); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stdafx.h : Includedatei für Standardsystem-Includedateien | |
// oder häufig verwendete projektspezifische Includedateien, | |
// die nur in unregelmäßigen Abständen geändert werden. | |
// | |
#pragma once | |
#include "targetver.h" | |
#include <stdio.h> | |
#include <tchar.h> | |
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen. | |
#include <iostream> | |
#include <string> | |
#include <list> | |
using namespace std; | |
using std::string; | |
using std::list; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment