Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class RachunekBankowy
- {
- private:
- enum RodzajKonta {ROR,LOKATA,JUNIOR,SENIOR,VIP,STUDENT};
- string imie;
- string nazwisko;
- string adres;
- string iban;
- float saldo;
- float oprocentowanieRachunku;
- float debet;
- float oprocentowanieDebetu;
- RodzajKonta rodzaj = ROR;
- public:
- RachunekBankowy ( string imieInfo, string NazwiskoInfo, string AdresInfo, string ibanInfo, float saldoInfo, float RachunekInfo, float debetInfo, float DebetuInfo)
- {
- this->imie = imieInfo;
- this->nazwisko = NazwiskoInfo;
- this->adres = AdresInfo;
- this->iban = ibanInfo;
- this->saldo = saldoInfo;
- this->oprocentowanieRachunku = RachunekInfo;
- this->debet = debetInfo;
- this-> oprocentowanieDebetu = DebetuInfo;
- }
- string getImie () { return this ->imie;}
- string getNazwisko() {return this->nazwisko;}
- string getAdres() { return this->adres;}
- string getInban() { return this->iban;}
- float getSaldo() { return this->saldo;}
- float getOprocentowanieRachunku (){ return this->oprocentowanieRachunku;}
- float getDebet () { return this->debet;}
- float getOprocentowanieDebetu() { return this->oprocentowanieDebetu;}
- bool setImie( string name)
- {
- this->imie = name;
- return true;
- }
- bool setNazwisko ( string surname )
- {
- this->nazwisko = surname;
- return true;
- }
- bool setAdres ( string adress)
- {
- this->adres = adress;
- return true;
- }
- bool setIban ( string IBAN)
- {
- this->iban = IBAN;
- return true;
- }
- bool setSaldo (float SALDO)
- {
- this->saldo = SALDO;
- return true;
- }
- bool setOpRach ( float oproc)
- {
- this->oprocentowanieRachunku = oproc;
- return true;
- }
- bool setOpDeb ( float oprocDeb)
- {
- this->oprocentowanieDebetu = oprocDeb;
- return true;
- }
- bool setDebet ( float Debit)
- {
- if ( Debit >= 0 )
- {
- this->debet = Debit;
- return true;
- }
- else
- {
- Debit = (-1) * Debit;
- this->debet = Debit;
- return true;
- }
- }
- float wplata ( float numer)
- {
- if ( numer >= 0)
- this->saldo += numer;
- else
- cout << "Enter valid number!" << endl;
- return saldo;
- }
- float wyplata ( float numer)
- {
- if ( numer >= 0)
- {
- if ( this->saldo - numer >= (this->debet * (-1)))
- {
- this->saldo -= numer;
- return this->saldo;
- }
- else
- {
- cout << "nie mozna wyplacic takiej kwoty, przekracza ona debet" << endl;
- return this->saldo;
- }
- }
- else
- cout << "enter valid number!" << endl;
- }
- float odsetki ()
- {
- if ( saldo > 0 )
- {
- saldo += saldo * oprocentowanieRachunku;
- }
- if ( saldo < 0)
- {
- saldo -= (saldo * (-1.0)) * oprocentowanieDebetu;
- }
- return saldo;
- }
- string toString ()
- {
- string wynik = to_string(saldo);
- wynik = wynik + " zlotych";
- return wynik;
- }
- };
- class Zleceniobiorca
- {
- string nazwa;
- int regon;
- public:
- RachunekBankowy rachunekBankowy;
- Zleceniobiorca ( string name, int r, RachunekBankowy rb )
- { // niewazne
- this->nazwa = name;
- this->regon = r;
- this->rachunekBankowy = rb;
- }
- string getNazwa()
- {
- return this->nazwa;
- }
- int getRegon()
- {
- return this->regon;
- }
- RachunekBankowy getRachunekBankowy()
- {
- return this->rachunekBankowy;
- }
- bool setNazwa ( string n)
- {
- this->nazwa = n;
- return true;
- }
- bool setRegon ( int r )
- {
- this->regon = r;
- return true;
- }
- bool setRachunek (RachunekBankowy rb)
- {
- this->rachunekBankowy = rb;
- return true;
- }
- };
- int main ()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement