logo

Crowdly

Browser

Add to Chrome

Objektno orijentirano programiranje (111/112/114/120)

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!

Zadana je klasa:

#include <iostream>

using namespace std;

class Registracija {

public:

  int reg1;

  int reg2;

  Registracija();

};

Registracija::Registracija() {

  reg1 = 100;

  reg2 = 100;

}

Odaberite ispravan kod main funkcije:

0%
0%
0%
0%
View this question

Što će ispisati slijedeći program?

#include<iostream>

using namespace std;

int main() {

  int x = 3;

  int& y = x;

  int z = 5;

  cout << x << y << z;

  y = z;

  cout << x << y << z;

  return 0;

}

0%
0%
0%
0%
View this question

Deklariran je niz imena x i pokazivač imena p:

 

int x[5];

int* p = x;

 

Koje su ispravne naredbe kojima se pomoću pokazivača p, svim elementima niza x pridjeljuje vrijednost 0, a zatim se, pomoću pokazivača p,  vrijednost 5 upisuje u element x[2]

0%
0%
0%
0%
View this question

Funkcija kao argument prima niz imena A tipa int i varijablu imena br tipa int, u kojoj je upisan broj elemenata niza A. Ispravan poziv funkcije iz glavnog programa je:

View this question

Potrebno je napisati preopterećenu funkciju koja računa i vraća kvadrat broja poslanog kao argument funkcije. Preopterećena funkcija treba raditi za vatijable tipa int i float. U glavnoj funkciji iskoristiti napisanu funciju varijable oba tipa.

Ispravni kod je:

View this question

Napišite ispis sljedećeg programa:

 

#include<iostream>

using namespace std;

int a;

void f() {

  a = 0;

  a++;

  cout << a;

}

int main() {

  int a = 3;

  cout << a;

  f();

  cout << a;

  f();

  cout << a;

  return(0);

}

0%
0%
0%
0%
View this question

Want instant access to all verified answers on moodle.srce.hr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome