Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Hesap{
- protected:
- double id;
- string name;
- string password;
- public:
- Hesap(string name1,string password1)
- {
- double randomId;
- srand (time(NULL));
- randomId=rand() % 1000;
- id=randomId;
- name=name1;
- password=password1;
- }
- string getName(){
- return name;
- }
- string getPassword(){
- return password;
- }
- double getId(){
- return id;
- }
- string setName(string name2){
- name=name2;
- }
- string setPw(string password2){
- password=password2;
- }
- virtual void setHesapBakiye(int bakiye1){
- }
- class Akbil: public Hesap{
- private:
- static double bakiye;
- public:
- Akbil(string name,string password)
- :Hesap(name,password)
- {
- }
- void setHesapBakiye(int bakiye1){
- cout<<"Akbile yatirmak istediginiz miktar nedir?:"<<endl;
- cin>>bakiye1;
- bakiye+=bakiye1;
- }
- int getAkbilInfo(){
- cout<<"Hesap Id'niz:"<<id<<" Isminiz: "<<name<<" Bakiyeniz: "<<bakiye<<endl;
- }
- class yemekKarti: public Hesap{
- private:
- static double bakiye;
- public:
- yemekKarti(string name,string password)
- :Hesap( name, password)
- {
- }
- void setHesapBakiye(int bakiye1){
- cout<<"Akbile yatirmak istediginiz miktar nedir?:"<<endl;
- cin>>bakiye1;
- bakiye+=bakiye1;
- }
- int getYemekKartiInfo(){
- cout<<"Hesap Id'niz:"<<id<<" Isminiz: "<<name<<" Bakiyeniz: "<<bakiye<<endl;
- }
- int main(){
- int whileCondition=-1;
- string girisSecim;
- vector<Hesap> createAccObj;
- void hesapOlustur(vector<Hesap>& newcreateAccObj){
- string name;
- string password;
- cout<<"-------------------"<<endl;
- cout<<"Enter your surname:"<<endl;
- cin>>name;
- cout<<"-------------------"<<endl;
- cout<<"Enter your password:"<<endl;
- cin>>password;
- Hesap newAcc(name,password);
- newcreateAccObj.push_back(newAcc);
- cout<<endl;
- bool hesapLogin(vector<Hesap>& newcreateAccObj){
- bool k=false;
- string name,password;
- cout<<"-----------------------"<<endl;
- cout<<"Please enter your surname: "<<endl;
- cin>>name;
- cout<<"-----------------------"<<endl;
- cout<<"Please enter your password"<<endl;
- unsigned int size=newcreateAccObj.size();
- for(unsigned int i=0;i<size;i++){
- string checkpw=newcreateAccObj[i].getPassword();
- string checkname=newcreateAccObj[i].getName();
- if(checkname==name && checkpw==password ){
- k=true;
- return k;
- }
- }
- return k;
- cout<<endl<<"Hangi hesabinizla devam etmek istersiniz?"<<endl;
- cout<<"1-Akbil 2-Yemek Karti"<<endl;
- cin>>secim;
- if(secim=="1"){
- string akbilsecim;
- system("CLS");
- cout<<"------------------------------"<<endl;
- cout<<"Akbil hesabiniza gecis yapildi."<<endl;
- Akbil createAkbilObj(name,password);
- cout<<"------------------------------"<<endl;
- cout<<"Seciminiz nedir?"<<endl;
- cout<<"1-Bakiye yukle 2-Bilgi Goruntuleme"<<endl;
- cout<<"---------------------------------------"<<endl;
- cin>>akbilsecim;
- if(akbilsecim=="1"){
- int miktar;
- createAkbilObj.setHesapBakiye(miktar);
- }
- else if(akbilsecim=="2"){
- createAkbilObj.getAkbilInfo(); //name= boş veriyor.
- }
- else{
- cout<<"Hatali islem yaptiniz, geri yonlendiriliyorsunuz"<<endl;
- goto akbilSecim;
- }
- Hesap Id'niz:4564(randomly) Isminiz:(nothing) Bakiyeniz: 456(randomly)
Add Comment
Please, Sign In to add comment