Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Direktor{
- private:
- string ime;
- string prezime;
- float plata;
- int brOddeli;
- bool bonus;
- public:
- //default konstruktor - bez argumenti
- Direktor(){
- this->ime="";
- this->prezime="";
- this->plata=0.0;
- this->brOddeli=0;
- this->bonus=true;
- }
- //konstruktor so argumenti
- Direktor(string ime,string prezime,float plata,int brOddeli,bool bonus){
- this->ime=ime;
- this->prezime=prezime;
- this->plata=plata;
- this->brOddeli=brOddeli;
- this->bonus=bonus;
- }
- Direktor(float plata,int brOddeli,bool bonus){
- this->ime="";
- this->prezime="";
- this->plata=plata;
- this->brOddeli=brOddeli;
- this->bonus=bonus;
- }
- string ime get_ime()
- {
- return ime;
- }
- string set_ime(string i)
- {
- ime = i;
- }
- string get_prezime()
- {
- return prezime;
- }
- string set_prezime(string p)
- {
- prezime = p;
- }
- float set_plata()
- {
- return plata;
- }
- float get_plata(float plata)
- {
- plata = plata;
- }
- int set_brOddeli()
- {
- return brOddeli;
- }
- int get_brOddeli(int brOddeli)
- {
- brOddeli=brOddeli;
- }
- bool set_bonus()
- {
- return bonus;
- }
- bool get_bonus(bool bonus)
- {
- bonus=bonus;
- }
- //copy konstruktor
- Direktor(const Direktor &d){
- this->ime=d.ime;
- this->prezime=d.prezime;
- this->plata=d.plata;
- this->brOddeli=d.brOddeli;
- this->bonus=d.bonus;
- }
- };
- int main()
- {
- int IzdadiPlata()
- {
- int result=plata+10*brOddeli;
- if(bonus)
- return result+=1000;
- return result;
- }
- // cout << "Hello world!" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement