Exam Code: CPA
Exam Name: C++ Certified Associate Programmer
Updated: Nov 17, 2024
Q&As: 220
At Passcerty.com, we pride ourselves on the comprehensive nature of our CPA exam dumps, designed meticulously to encompass all key topics and nuances you might encounter during the real examination. Regular updates are a cornerstone of our service, ensuring that our dedicated users always have their hands on the most recent and relevant Q&A dumps. Behind every meticulously curated question and answer lies the hard work of our seasoned team of experts, who bring years of experience and knowledge into crafting these premium materials. And while we are invested in offering top-notch content, we also believe in empowering our community. As a token of our commitment to your success, we're delighted to offer a substantial portion of our resources for free practice. We invite you to make the most of the following content, and wish you every success in your endeavors.
Experience Passcerty.com exam material in PDF version.
Simply submit your e-mail address below to get started with our PDF real exam demo of your C++ Institute CPA exam.
Instant download
Latest update demo according to real exam
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class B;
class A {
int age;
public:
A () { age=5; };
friend class B;
};
class B {
string name;
public:
B () { name="Bob"; };
void Print(A ob) {
cout << name << ob.age;
}
};
int main () {
A a;
B b;
A. Print(a); return 0; }
B. It prints: Bob5
C. It prints: Bob
D. It prints: 5
E. None of these
How could you pass arguments to functions?
A. by value
B. by reference
C. by pointer
D. by void
What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
int mult(int f, int s, int t);
int main()
{
cout << mult(1,2,3);
return 0;
}
int mult(int f, int s, int t)
{
int mult_res;
mult_res = f*s*t;
return mult_res;
}
A. It prints: 0
B. It prints: 6
C. It prints: 2
D. It prints: 3
What is the output of the program?
#include
using namespace std;
class Base {
static int age;
public:
Base () {};
~Base () {};
void setAge(int a=10) {age = a;}
void Print() { cout << age;}
};
int Base::age=0;
int main () {
Base a,*b;
b = new Base();
A. setAge(); b?>setAge(20);
B. Print(); b?>Print(); return 0; }
C. It prints: 2020
D. It prints: 1020
E. It prints: 20
F. It prints: 10
What happens when you attempt to compile and run the following code? #include
#include
class Second;
class Base {
int age;
public:
Base () { age=5; };
friend void set(Base andob, Second andso);
void Print() { cout << age;}
};
class Second {
string name;
public:
friend void set(Base andob, Second andso);
void Print() { cout << name;}
};
void set(Base andob, Second andso) {
ob.age = 0; so.name = "Bill";
}
int main () {
Base a;
Second b;
set(a,b);
A. Print();
B. Print(); return 0; }
C. It prints: 0Bill
D. Compilation error
E. It prints: Bill0
F. None of these
Viewing Page 1 of 3 pages. Download PDF or Software version with 220 questions