Quiz
Тест 15
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (10)
1What will be printed on the standard output after the execution of the following program code:

- A777
- B77
- C7777
- D7
2What will be printed on the standard output after the execution of the following program code:

- A1 2 1 2 3
- B1 3 1 2 3
- C2 2 1 2 3
- D2 3 1 2 3
3Given the class:

- Ac=7.4 - b;
- Bc=12.7 + a;
- Cc=a + 5.3;
- Dc=b - 8.6;
4Given the program code:
typedef struct oopStruktura { int i; }oopStr;
typedef oopStr *pok; oopStr prom; pok prom_pok =&prom;
Which of the following expression is valid?- Aprom_pok.i=7;
- Bprom_pok->i=7;
- CoopStr->i=7;
- Dprom->i=7;
5Given the program code:
class Eng{
int a;
};
Eng e1, *e2=&e1;
How do we access the attribute from e2?- Ae2::a
- Be2.a
- Ce2->a
- Dit cannot be accessed
6Given the class:
class Test{
private: char* s;
public: //...
};
Which of the following would be a valid copy constructor for class Test:- ATest(const Test& t) { s = new char[ strlen(t.s) + 1]; strcpy(s, t.s); }
- BTest(const Test t) { s = new char[ strlen(t.s) + 1]; strcpy(s, t.s); }
- CTest(const char* t) { s = new char[ strlen(t) + 1]; strcpy(s, t); }
- DTest() { s = new char[ 100 ]; }
7In how many different ways the function can be called:
int Volume (int x, int y=0, int z=3) {return x*y*z; }- A4
- B1
- C3
- D2
8What will be the output of the execution of the following program code:

- ADC-G2 DC-Student DC-Student DC-G2 DC-Student DC-Student DC-G2 DC-Student DC-Student
- BDC-Student DC-Student DC-G2
- CDC-G2 DC-G2 DC-G2
- DDC-Student DC-Student DC-G2 DC-Student DC-Student DC-G2 DC-Student DC-Student DC-G2
9What will be the output of the execution of the following program code:

- A0 7 8 7 8 9
- B0 2 0 7 0 0
- C0 2 3 7 8 9
- Derror the enum isn't defined right
10What is the correct way for dynamic memory allocation for an array of 35 integer numbers?
- Aint a[35];
- Bint a= new int[35];
- Cint *a = new int[35];
- Dint a[]=new int(35);
Information
- Description
- OOP Quiz on Тест 15, created by Code Purpose on 02/05/2020.
- Author
- Code Purpose
- Language
- English
- Views
- 178
- Tags
- Rating
- No ratings yet Rate this quiz