-
Notifications
You must be signed in to change notification settings - Fork 0
/
osoba.cpp
42 lines (41 loc) · 977 Bytes
/
osoba.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "osoba.hpp"
Osoba::Osoba(string ime, string prezime, int godina) : ime(ime), prezime(prezime), godina(godina) {}
Osoba::Osoba(string ime, string prezime) : Osoba(ime, prezime, 0) {}
Osoba::Osoba(string ime, int godina) : Osoba(ime, "", godina) {}
Osoba::Osoba(string ime) : Osoba(ime, "", 0) {}
Osoba::Osoba(int godina) : Osoba("", "", godina) {}
Osoba::Osoba() : Osoba("", "", 0) {}
string Osoba::getIme()
{
return ime;
}
string Osoba::getPrezime()
{
return prezime;
}
int Osoba::getGodina()
{
return godina;
}
void Osoba::setIme(string ime)
{
this->ime = ime;
}
void Osoba::setPrezime(string prezime)
{
this->prezime = prezime;
}
void Osoba::setGodina(int godina)
{
this->godina = godina;
}
void Osoba::info()
{
std::cout << "Ime: " << ime << std::endl;
std::cout << "Prezime: " << prezime << std::endl;
std::cout << "Godina: " << godina << std::endl;
}
float Osoba::sansaZaRodjendanskiPoklon()
{
return abs((90 - godina));
}