CPA PDF

How to use our free PDF

Our Free PDF is based on the full mock exams which is available on our Web Site. The PDF consists in an extract of questions and answers with detailed explanations that are available to be:

  
C++ Institute CPA
C++ Certified Associate Programmer
C++ Institute CPA Dumps Available Here at:
http://blog.giftovus.com/?tell=c-plus-plus-institute-exam/cpa-dumps.html
Enrolling now you will get access to 220 questions in a unique set of CPA dumps
Question 1
What will the variable "age" be in class B? class A {
int x;
protected:
int y;
public:
int age;
A () { age=5; }; };
class B : public A { string name;
public:
B () { name="Bob"; }; void Print() {
cout << name << age; }
};
Options:
A. public
B. private
C. protected
D. None of these Answer: A
Question 2
 https://www.certification-questions.com

C++ Institute CPA
What happens when you attempt to compile and run the following code? #include 
#include 
using namespace std;
class complex{
double re, im;
public:
complex() : re(1),im(0.4) {}
complex operator(complex &t);
void Print() { cout << re << " " << im; } }
complex complex::operator (complex &t){ complex temp;
temp.re = this>re t.re;
 temp.im = this>im return temp;
}
int main(){ complex c1,c2,c3; c3 = c1 c2; c3.Print();
}
Options:
A. It prints: 1 0.4 B. It prints: 2 0.8 C. It prints: 0 0 D. It prints: 1 0.8 Answer: C
Question 3
t.im;
What happens when you attempt to compile and run the following code? #include 
using namespace std;
class complex{
double re; double im;
https://www.certification-questions.com

C++ Institute CPA
public:
complex() : re(0),im(0) {} complex(double x) { re=x,im=x;}; complex(double x,double y) { re=x,im=y;} void print() { cout << re << " " << im;}
};
int main(){ complex c1; c1 = 3.0; c1.print(); return 0;
}
Options:
A. It prints: 0 0
B. It prints: 1 1
C. It prints: 3 3
D. Compilation error Answer: C
Question 4
What happens when you attempt to compile and run the following code? #include 
using namespace std;
void fun(int);
int main() {
int a=0; fun(a); return 0; }
void fun(int n) {
if(n < 2)
 https://www.certification-questions.com

C++ Institute CPA
{ fun(++n); cout << n; }
}
Options:
A. It prints: 21
B. It prints: 012 C. It prints: 0
D. None of these Answer: A
Question 5
What happens when you attempt to compile and run the following code? #include 
using namespace std;
int s(int n);
int main()
{
int a;
a = 3;
cout << s(a); return 0;
}
int s(int n)
{
if(n == 0) return 1; return s(n?1)*n;
}
Options:
A. It prints: 4 B. It prints: 6 C. It prints: 3
 https://www.certification-questions.com

C++ Institute CPA
D. It prints: 0
Answer: B
Question 6
What will be the output of the program? #include 
using namespace std;
int fun(int);
int main()
{
cout << fun(5); return 0;
}
int fun(int i) {
return i*i;
}
Options:
A. 25
B. 5
C. 0
D. 1 Answer: A
Question 7
What happens when you attempt to compile and run the following code? #include 
using namespace std;
#define FUN(arg) if(arg) cout<<"Test";
int main()
 https://www.certification-questions.com

C++ Institute CPA
{
int i=1; FUN(i<3); return 0;
}
Options:
A. It prints: 0
B. It prints: T
C. It prints: T0 D. It prints: Test Answer: D
Question 8
What will the variable "y" be in class B? class A {
int x;
protected:
int y; public: int age; };
class B: private A { string name; public:
void Print() {
cout << name << age; }
};
Options:
A. public
B. private
C. protected
D. None of these Answer: B
 https://www.certification-questions.com

C++ Institute CPA
Question 9
What happens when you attempt to compile and run the following code? #include 
using namespace std;
int main()
{
float x=3.5,y=1.6; int i,j=2;
i = x + j + y;
cout << i;
return 0;
}
Options:
A. It prints: 7
B. It prints: 6
C. It prints: 7,1
D. Compilation error Answer: A
Question 10
What happens when you attempt to compile and run the following code? #include 
using namespace std;
int main(){ int i = 1;
if (i==1) { cout << i;
} else { cout << i-1; }
return 0; }
Options:
A. It prints: 0
 https://www.certification-questions.com

C++ Institute CPA
B. It prints: 1 C. It prints: -1 D. It prints: 2 Answer: B
Would you like to see more? Don't miss our CPA PDF file at:
http://blog.giftovus.com/?tell=c-plus-plus-institute-pdf/cpa-pdf.html
 https://www.certification-questions.com