CPA-21-02

Practice CPA-21-02 Exam

Is it difficult for you to decide to purchase C++ Institute CPA-21-02 exam dumps questions? CertQueen provides FREE online CPA – C++ Certified Associate Programmer CPA-21-02 exam questions below, and you can test your CPA-21-02 skills first, and then decide whether to buy the full version or not. We promise you get the following advantages after purchasing our CPA-21-02 exam dumps questions.
1.Free update in ONE year from the date of your purchase.
2.Full payment fee refund if you fail CPA-21-02 exam with the dumps

 

 Full CPA-21-02 Exam Dump Here

Latest CPA-21-02 Exam Dumps Questions

The dumps for CPA-21-02 exam was last updated on May 19,2025 .

Viewing page 1 out of 10 pages.

Viewing questions 1 out of 52 questions

Question#1

What happens when you attempt to compile and run the following code?
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main(void)
{
string s;
s = "Test";
s.resize (s.size() ? 1);
cout<<s<<" "<<s.size();
return 0;
}

A. It prints: Test 4
B. It prints: Test 3
C. Compilation error
D. It prints: Tes 3

Question#2

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class First
{
public:
void Print(){ cout<<"from First";}
};
class Second:public First
{
public:
void Print(){ cout<< "from Second";}
};
void fun(First *obj);
int main()
{
First FirstObject;
fun(&FirstObject);
Second SecondObject;
fun(&SecondObject);
}
void fun(First *obj)
{
obj?>Print();
}

A. It prints: from First
B. It prints: from Firstfrom First
C. It prints: from Firstfrom Second
D. It prints: from Secondfrom Second

Question#3

Analyze the code below. If it contains an error, indicate its place in the program.


A. Error in the for loop
B. Error in the break statement
C. No error
D. Error in the if statement

Question#4

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class A {
public:
virtual void Print()=0;
};
class B: public A {
public:
virtual void Print() { cout<< "B"; }
};
class C: public A {
public:
virtual void Print() { cout<< "C"; }
};
int main()
{
Bob2;
Cob3;
A*obj;
obj = &ob2;
obj?>Print();
obj = &ob3;
obj?>Print();
}

A. It prints: BC
B. It prints: CB
C. It prints: CC
D. It prints: BB

Question#5

What will be the output of the program?
#include <iostream>
#include <string>
using namespace std;
int fun(int);
int main()
{
float k=3;
k = fun(k);
cout<<k;
return 0;
}
int fun(int i)
{
i++;
return i;
}

A. 3
B. 5
C. 4
D. 5

Exam Code: CPA-21-02         Q & A: 257 Q&As         Updated:  May 19,2025

 

 Full CPA-21-02 Exam Dumps Here