Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void backend::przelew()
- {
- konto *pom1 = new konto;
- konto *pom2 = new konto;
- bool zn1 = false;
- bool zn2 = false;
- bool wyst = false;
- cout << "Podaj numer rachunku z ktorego chcesz przelac pieniadze: ";
- cin >> nr;
- cout << "Podaj kwote przelewu: ";
- cin>>ile;
- it = klienci.begin();
- while (it != klienci.end())
- {
- for (i = it->konta.begin(); i != it->konta.end(); i++)
- {
- if ((*i).numer == nr)
- {
- zn1 = true;
- if ((*i).bilans >= ile)
- {
- wyst = true;
- (*i).wyplata(ile);
- pom1 = &(*i);
- }
- break;
- }
- if (zn1) break;
- }
- if (zn2) break;
- it++;
- }
- if (zn1 == true)
- {
- if (wyst == true)
- {
- cout << "Podaj numer rachunku na ktory chcesz przelac pieniadze: ";
- cin >> nr2;
- it = klienci.begin();
- while (it != klienci.end())
- {
- for (j = it->konta.begin(); j != it->konta.end(); j++)
- {
- if ((*j).numer == nr2)
- {
- zn2 = true;
- pom2 = &(*j);
- break;
- }
- if(zn2) break;
- }
- if(zn2) break;
- it++;
- }
- if (zn2 == true)
- {
- pom1->wyplata(ile);
- pom2->wplata(ile);
- cout << "Przelew wykonano prawidlowo!" << endl;
- }
- else
- cout << "Brak konta na ktore mial przyjsc przelew" << endl;
- }
- else
- cout << "Brak wystarczajacych srodkow na wykonanie przelewu!" << endl;
- }
- else
- cout << "Brak rachunku z ktorego mial wyjsc przelew" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement