Tuesday, May 26, 2015

#6 cZivotinja.h

#ifndef CZIVOTINJA_H
#define CZIVOTINJA_H

#include <iostream>

using namespace std;

class cZivotinja{
   private:
      int godine;
   public:
      string ime;
      string vrsta;
      string pol;
      cZivotinja();
      ~cZivotinja();
      //FUNKCIJE SE KORISTE ZA NASLEDJIVANJE ATRIBUTA
      void setGodine(int _godine);
      void scanIme();
      void scanPol();
      void scanVrsta();
      void scanGodine();
 
      int getGodine();
      string getIme();
      string getPol();
      string getVrsta();
      //
};
// Prazni konstruktor i destruktor
cZivotinja::cZivotinja(){
}

cZivotinja::~cZivotinja(){
}
//
void cZivotinja::setGodine(int _godine){
   this->godine = _godine;
}
void cZivotinja::scanGodine(){
   cout << "Unesite godine: ";
   cin >> this->godine;
   setGodine(this->godine);
}
void cZivotinja::scanIme(){
   cout << "Unesite ime: ";
   cin >>this->ime;
}
void cZivotinja::scanPol(){
   string _pol;
   cout << "Unesite pol: ";
   cin >> _pol;
   this->pol = _pol;
}
void cZivotinja::scanVrsta(){
   string _vrsta;
   cout << "Unesite vrstu: ";
   cin >> _vrsta;
   this->vrsta = _vrsta;
}

int cZivotinja::getGodine(){
   return this->godine;
}
string cZivotinja::getIme(){
   return this->ime;
}
string cZivotinja::getPol(){
   return this->pol;
}
string cZivotinja::getVrsta(){
   return this->vrsta;
}

#endif

No comments:

Post a Comment