CPA Exam Preparation Material | C++ Certified Associate Programmer

Prepare for the CPA with reliable study materials, practice questions, and key exam insights.

Prepare for the CPA C++ Certified Associate Programmer exam with CertQueen's independently developed study resources. Review important concepts, practice scenario-based questions, and use clear explanations to identify areas that require further study.

Question#1

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class A {
public:
int x;
A() { x=0;}
};
class B : protected A {
public:
int y;
using A::x;
B(int y) {this?>y = y;}
void Print() { cout << x << y; }
};
int main () {
B b(5);
b.Print();
return 0;
}
A.It prints: 05
B.It prints: 0
C.It prints: 5
D.It prints: 15

A. A

Question#2

Which code, inserted at line 12, generates the output "5b"?
#include <iostream>
using namespace std;
namespace myNamespace1
{
int var = 5;
}
namespace myNamespace2
{
char var = 'b';
}
int main () {
//insert code here
return 0;
}
A.cout << myNamespace1::var << var;
B.cout << var << var;
C.cout << myNamespace1::var << myNamespace2::var;
D.None of these

A. C

Question#3

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
int x=5;
static int y=0;
void myFunction(int a)
{
y=++a;
}
int main (int argc, const char * argv[])
{
int i=0;
myFunction(i);
cout<<y<<" "<<x;
}
A.It prints: 0 5
B.It prints: 5 1
C.It prints: 1 5
D.It prints: 5 0

A. C

Question#4

What happens when you attempt to compile and run the following code?
#include <iostream>
using namespace std;
class First
{
public:
First() { cout << "Constructor";}
void Print(){ cout<<"from First";}
};
int main()
{
First FirstObject;
FirstObject.Print();
}
A.It prints: Constructorfrom First
B.It prints: Constructor
C.It prints: from First
D.None of these

A. A

Question#5

What happens when you attempt to compile and run the following code?
#include <iostream>
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

A. B

Exam Code: CPA
Q & A: 220 Q&As         Updated:  Oct 07,2026

 

 Access Complete CPA Preparation Material

What This CPA Study Resource Helps You Do

Review Key Concepts

Review the technologies, products, processes, and practical skills covered by the current CPA exam objectives.

Practice Scenario-Based Questions

Work through independently developed questions designed to strengthen your understanding of technical scenarios and decision-making.

Identify Knowledge Gaps

Use your results and the provided explanations to find weaker areas and focus your study more effectively.

How to Use This CPA Preparation Material

Review the Exam Scope

Start by reviewing the topics covered by the CPA exam. Compare them with the official exam objectives to understand the required technologies, operational tasks, and practical skills, then identify the areas that deserve the most attention.

Practice Independently

Complete a focused set of practice questions for each topic. On your first attempt, avoid referring to notes, answers, or other study resources so that you can evaluate your current understanding more accurately.

Study the Explanations

Review the answers and explanations after completing each practice session. Understand why the correct option is appropriate for the given scenario and why the other options may be incorrect or less suitable.

Close Knowledge Gaps

Keep track of incorrect answers, unfamiliar concepts, and weaker knowledge areas. Review these topics using official documentation and practical experience, then answer the related questions again to reinforce your understanding and monitor your progress.

Independent CPA Preparation Resource

CertQueen independently develops its certification study materials for educational purposes. The practice questions are not copied from, recalled from, or presented as live or official exam questions.

CertQueen is not affiliated with, endorsed by, sponsored by, or authorized by any certification provider. Certification names, exam codes, product names, and related trademarks are the property of their respective owners and are referenced only for identification and educational purposes.

Exam Code: CPA
Q & A: 220 Q&As
Updated:  Oct 07,2026

 

 Access Complete CPA Preparation Material