Тест 4

Beschreibung

OOP Quiz am Тест 4, erstellt von Code Purpose am 02/05/2020.
Code Purpose
Quiz von Code Purpose, aktualisiert more than 1 year ago
Code Purpose
Erstellt von Code Purpose vor etwa 4 Jahre
606
0

Zusammenfassung der Ressource

Frage 1

Frage
На колку различни начини може да се повика функцијата: int Volume(int x, int y , int z ) { return x*y*z;} 1
Antworten
  • 1
  • 2
  • 3
  • 4

Frage 2

Frage
Како се вика стандардниот простор со имиња (namespace) за работа со функциите за стандарден влез и излез
Antworten
  • stdio
  • std
  • iostream
  • cstring

Frage 3

Frage
Ако го имаме следниот код: class X{ public: int *x; X (int xx) { x = new int; *x = xx;} }; X *obj = new X[3] Како ќе пристапиме до вредноста на атрибутот x во овјектот obj?
Antworten
  • obj->x
  • *(obj.x)
  • *(obj->x)
  • obj.x

Frage 4

Frage
Што ќе отпечати програмата class C { public: int a; C() { cout << "a "; }; C(int aa) { a = aa; cout << "b "; }; C(const C & c) { a = c.a; cout << "c "; }; ~C() { cout << "d "; }; }; int main() { C c1, c2(c1), c3; c1 = c3; }
Antworten
  • a c a d d d
  • a b d d d
  • a c b d d d
  • a b c b d d

Frage 5

Frage
Кој е валиден прототип за Copy конструктор на класата Circle: class Circle { private: int x, y, r; public: … }
Antworten
  • Circle {const Circle &circle};
  • Circle {const Circle *circle};
  • Circle {Circle &c};
  • Circle {const & Circle c};

Frage 6

Frage
Дефинирана е следната класа: class Broj { private: int x; public: Broj(int xx = 1) { x = xx; cout << x; } Broj(const Broj & b) { cout << b.x; } }; Што ќе отпечати по извршувањето на следниот програмски код: Broj br1; Broj br2(br1); br1 = br2;
Antworten
  • 11
  • X
  • 111
  • 1

Frage 7

Frage
Што треба да се вклучи во С++ за да се овозможи употреба на стандардните влезо-излезни текови?
Antworten
  • #include <stdio.h>
  • #include <fstream>
  • #include <iostream>
  • #include <stdio>

Frage 8

Frage
Што ќе отпечати програмата: class C { public: int x; C() { cout << "1 "; } C(const C & c) { x = c.x; cout << "2 "; } C & operator = (const C & c) { x = c.x; cout << “3“; return *this; } }; int main() { C a; C b = a; a = b; return 0; }
Antworten
  • 1 3 3
  • 1 2 3
  • 1 3 2
  • 1 1 2

Frage 9

Frage
Даден е следниот код: typedef struct Struktura { int i; } Str; typedef Str * pok; Str prom; pok prom_pok = *prom; Која од следните наредби е валидна ?
Antworten
  • prom_pok.i = 10;
  • prom_pok->i = 10;
  • Str->i = 10;
  • prom->i = 10;

Frage 10

Frage
Што е НЕ е точно:
Antworten
  • Деструктор на дадена класа се повикува при излегување од блок за објект инсталиран во тој блок
  • Деструктор на дадена класа се повикува при излегување од функција со параметар што се пренесува по вредност;
  • Default конструктор се повикува при пренос на објект како аргумент (по вредност) на функција
  • Copy конструкторот се повикува при враќање на објект како резултат на функција
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Object Oriented Programming Concepts
Cmagapu
Concepts of Objects and Classes
BK Modding
Introduction to Java
BK Modding
Paradigma de Programación Orientado a Objetos
JULIAN CAMILO RIVEROS FONSECA
1.2.4 OOP
Louis N
constructor
balakvm.it
Classes
needajob517
OOP Definitions
Matt Dumbrill
Object Oriented Programming Concepts
agni bharathi
Object Oriented Programming Concepts
Rian McCollom