Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Ucenik {
- private:
- string ime;
- float prosek;
- int broj_na_polozeni_predmeti;
- public:
- Ucenik() {} // default(empty) constructor
- Ucenik(string ime, float prosek, int broj_na_polozeni_predmeti) {
- this->ime = ime;
- this->prosek = prosek;
- this->broj_na_polozeni_predmeti = broj_na_polozeni_predmeti;
- }
- Ucenik(const Ucenik & tmp) {
- this->ime = tmp.ime;
- this->prosek = tmp.prosek;
- this->broj_na_polozeni_predmeti = tmp.broj_na_polozeni_predmeti;
- }
- string get_ime() {
- return ime;
- }
- };
- int main() {
- Ucenik u1;
- Ucenik u2("Josif", 9.1, 35);
- Ucenik u3(u2);
- cout << u2.get_ime() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment