Cpp Programming Quiz 230 – A constructor that accepts __________ parameters is called the default constructor.
[A].
one
[B].
two
[C].
no
[D].
three
Answer: Option C
Explanation:
No answer description available for this question.
two
[C].
no
[D].
three
Answer: Option C
Explanation:
No answer description available for this question.
Answer: Option A
Linker
[C].
Loader
[D].
Compiler
Answer: Option D
Explanation:
No answer description available for this question.
#include
class BixBase
{
public:
BixBase()
{
cout<< "Base OK. ";
}
~BixBase()
{
cout<< "Base DEL. ";
}
};
class BixDerived: public BixBase
{
public:
BixDerived()
{
cout<< "Derived OK. ";
}
~BixDerived()
{
cout<< "Derived DEL. ";
}
};
int main()
{
BixBase *basePtr = new BixDerived();
delete basePtr;
return 0;
}
[A].Base OK. Derived OK.
[B].Base OK. Derived OK. Base DEL.
[C].Base OK. Derived OK. Derived DEL.
[D].Base OK. Derived OK. Derived DEL. Base DEL.
Answer: Option B
[B].
[C].
[D].
Answer: Option B
Explanation:
The statement 1 and 2 does not yield the base address of the array. While the scanf() and printf() yields the base address of the array.
#include
class Base
{
int x, y;
public:
Base()
{
x = y = 0;
}
Base(int xx)
{
x = xx;
}
Base(int p, int q = 10)
{
x = p + q;
y = q;
}
void Display(void)
{
cout<< x << " " << y << endl;
}
}objDefault(1, 1);
class Derived: public Base
{
Base obj;
public:
Derived(int xx, int yy): Base(xx, xx + 1)
{ }
Derived(Base objB = objDefault)
{ }
};
int main()
{
Derived objD(5, 3);
Derived *ptrD = new Derived(objD);
ptrD->Display();
delete ptrD;
return 0;
}
[A].3 2
[B].8 3
[C].11 6
[D].11 10
Answer: Option C
[C]. Class is an instance of data type.
[D]. Object is an instance of data type.
Answer: Option B