Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class TRachunek
- {
- string imie, nazwisko;
- double saldo;
- double debet;
- public:
- TRachunek(string i, string n, double s=0, double d=0)
- {
- imie=i;
- nazwisko=n;
- saldo=s;
- debet=d;
- }
- double PodajStanKonta()
- {
- return saldo;
- }
- void Wplata(double n)
- {
- saldo+=n;
- }
- bool Wyplata(double n)
- {
- if((saldo-n)>=debet)
- return true;
- else return false;
- }
- bool CzyDebet ()
- {
- if (saldo<0)
- return true;
- else return false;
- }
- bool Przelew(TRachunek *&rachunek, double kwota)
- {
- this->saldo-=kwota;
- if(this->saldo>=0)
- {
- rachunek->Wplata(kwota);
- return true;
- }
- else return false;
- }
- double NaliczOdstetki(double oprocentowanie)
- {
- oprocentowanie+=saldo*0.01*oprocentowanie;
- return oprocentowanie;
- }
- void Wyswietl()
- {
- cout<<"twoje saldo wyniosi: "<<saldo<<endl<<"twoj debet wynosi: "<<debet<<endl;
- }
- ~TRachunek()
- {
- ;
- };
- };
- int main()
- {
- cout<<"Alicja Nowak:"<<endl;
- TRachunek ror("Alicja","Nowak");
- ror.Wplata(400);
- cout<<"Oprocentowanie wynosi: "<<ror.NaliczOdstetki( 2.3)<<endl;
- ror.Wyswietl();
- TRachunek * pror;
- pror= new TRachunek("Jan","Kowalski", 1000, 500);
- ror.Przelew(pror, 350);
- cout<<"Jan Kowalski:"<<endl;
- pror->Wyswietl();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement