Тест 4

Descrição

OOP Quiz sobre Тест 4, criado por Code Purpose em 02-05-2020.
Code Purpose
Quiz por Code Purpose, atualizado more than 1 year ago
Code Purpose
Criado por Code Purpose mais de 4 anos atrás
607
0

Resumo de Recurso

Questão 1

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

Questão 2

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

Questão 3

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

Questão 4

Questão
Што ќе отпечати програмата 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; }
Responda
  • a c a d d d
  • a b d d d
  • a c b d d d
  • a b c b d d

Questão 5

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

Questão 6

Questão
Дефинирана е следната класа: 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;
Responda
  • 11
  • X
  • 111
  • 1

Questão 7

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

Questão 8

Questão
Што ќе отпечати програмата: 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; }
Responda
  • 1 3 3
  • 1 2 3
  • 1 3 2
  • 1 1 2

Questão 9

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

Questão 10

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

Semelhante

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