What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class A {
public:
A() { cout << "A no parameters";}
A(string s) { cout << "A string parameter";}
A(A anda) { cout << "A object A parameter";}
};
class B : public A {
public:
B() { cout << "B no parameters";}
B(string s) { cout << "B string parameter";}
};
int main () {
A a1;
A a2("Test");
B b1("Alan");
return 0;
}
A. It prints: A no parametersA string parameterA no parametersB string parameter
B. It prints: A no parametersB string parameter
C. It prints: B string parameter
D. It prints: B no parameter
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main (int argc, const char * argv[])
{
int tab[5]={1,2,3};
for (int i=0; i<5; i++)
cout < return 0; } A. compilation fails B. It prints: 12300 C. It prints: 12345 D. It prints: 00000
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class A {
public:
void Print(){ cout<<"A";}
};
class C:public A {
public:
virtual void Print()=0;
};
int main()
{
C obj3;
obj3?>Print();
}
A. It prints: BB
B. It prints: A
C. It prints: AB
D. Compilation error
What will happen when you attempt to compile and run the following code?
#include
using namespace std;
int main (int argc, const char * argv[])
{
enum state { ok, error, warning};
enum state s1, s2, s3;
s1 = ok;
s2 = warning;
s3 = error;
s4 = ok;
cout << s1<< s2<< s3;
return 0;
}
A. It will print:"123"
B. compilation error
C. It will print:"021"
D. It will print:"132"
Which of the following is a user defined data type?
1:
struct person
{
char name[20];
int age;
};
2:
int l=2;
3:
enum color {red,blue, green};
A.
char c;
B.
1
C.
2
D.
3
E.
4
What happens when you attempt to compile and run the following code?
#include
using namespace std;
class First
{
public:
First() { cout << "Constructor";}
~First() { cout << "Destructor";}
void Print(){ cout<<"from First";}
};
int main()
{
First FirstObject;
FirstObject.Print();
}
A. It prints: Constructorfrom First
B. It prints: Constructorfrom FirstDestructor
C. It prints: Constructorfrom FirstDestructorDestructor
D. Compilation error at line 16
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main()
{
int i = 5;
cout<<"Hello World" << ++i;
return 0;
}
A. It prints: Hello World6
B. It prints: Hello
C. It prints: World
D. It prints: Hello World5
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int fun(int x) {
return 2*x;
}
int main(){
int i;
i = fun(1) || fun(2);
cout << i;
return 0;
}
A. It prints: 0
B. It prints: 1
C. It prints: -1
D. Compilation error
Which code, inserted at line 8, generates the output "100"?
#include
using namespace std;
int fun(int);
int main()
{
int *x = new int;
*x=10;
//insert code here
return 0;
}
int fun(int i)
{
return i*i;
}
A. cout << fun(*x) ;
B. cout << fun(10);
C. cout << fun(5) ;
D. cout << fun(y) ;
Which definitions are correct?
A. int age;
B. int double;
C. char c;
D. int char;
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only C++ Institute exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your CPA exam preparations and C++ Institute certification application, do not hesitate to visit our Vcedump.com to find your solutions here.