Looking for Objektno orijentirano programiranje (111/112/114/120) test answers and solutions? Browse our comprehensive collection of verified answers for Objektno orijentirano programiranje (111/112/114/120) at moodle.srce.hr.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Napišite ispis sljedećeg programa:
#include<iostream>using namespace std;
int a = 10;
void funkcija() { cout << a; }int main() { int a = 17; cout << a; funkcija(); return 0; }
Što će biti ispisano nakon izvršenja programa:
#include<iostream>using namespace std;
int A(int x) { return 3 * x; }void B(int x, int& y) { y = A(x) + 3; }
int main() { int a = 3, b = 0, c;
a = A(b); cout << a; B(a, b); cout << b; B(a, c); cout << c;
return 0;}
Zadana je klasa:
class Tocka {
public:
double x, y;
Tocka();
double UdaljenostOdIshodista();
void IspisiAdresu();
};
Funkcija IspisiAdresu() treba ispisati adresu objekta klase Tocka za koji je pozvana. Ispravna implementacija je:
Što će se dogoditi prilikom pokretanja slijedećeg programa:
#include <iostream>using namespace std;int main() { int x = 0; int& ref = 5; cout << ref;
return 0;}