Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute CPP - C++ Certified Professional Programmer Exam

Certification Provider: C++ Institute
Exam Name: CPP - C++ Certified Professional Programmer
Duration: 65 Minutes
Number of questions in our database: 228
Exam Version: Feb. 22, 2024
Exam Official Topics:
  • Topic 1: Typical problems when using templates/ Types of sequential containers
  • Topic 2: Classes which provide the input and output capability/ STL Sequential containers
  • Topic 3: Sequential container adapters ?stack, queue and priority queue/ Modifying STL algorithms
  • Topic 4: Dealing with objects as container elements/ STL utilities and functional library
  • Topic 5: List of merging algorithms: merge, includes, min_element, max_element, inplace_merge/ Types of associative containers
  • Topic 6: Putting objects into set and map/ Definition of a modifying algorithm
  • Topic 7: Definition of a non-modifying algorithm/ List of useful functors
  • Topic 8: STL Associative containers/ List of sorting algorithms: random_shuffle, sort, stable_partition, lower_bound, upper_bound
  • Topic 9: Containers compatibility/ Set and multiset ?behavior and API/ map and multimap ?behavior and API

Free C++ Institute CPP - C++ Certified Professional Programmer Exam Actual Questions

The questions for CPP - C++ Certified Professional Programmer were last updated On Feb. 22, 2024

Question #1

What happens when you attempt to compile and run the following code?

#include

#include

using namespace std;

int main() {

int t[] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };

string s[] = { "one", "one", "two", "two", "three","three", "four", "four", "five", "five"};

multimap m;

for (int i = 0; i < 10; i++) {

m.insert(pair(t[i], s[i]));

}

if (m.count(3) == 2) {

m.erase(3);

}

for (multimap::iterator i = m.begin(); i != m.end(); i++) {

cout << i?>first << " ";

}

return 0;

}

Reveal Solution Hide Solution
Correct Answer: D

Question #2

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: true true?

#include

#include

using namespace std;

int main ()

{

bool a,b;

cin>>a>>b;

cout<

return 0;

}

Program will output:

Reveal Solution Hide Solution
Correct Answer: E

Question #3

What happens when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) { out<

struct Add {

int operator()(int & a, int & b) {

return a+b;

}

};

int main() {

int t[]={1,2,3,4,5,6,7,8,9,10};

vector v1(t, t+10);

vector v2(10);

transform(v1.begin(), v1.end(), v2.begin(), bind1st(1,Add()));

for_each(v2.rbegin(), v2.rend(), Out(cout));cout<

return 0;

}

Program outputs:

Reveal Solution Hide Solution
Correct Answer: E

Question #4

What will happen when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

int main(){

int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };

vectorv(t, t+10);

set s1(v.begin(),v.end());

s1.insert(v.begin(),v.end());

pair::iterator,set::iterator> range;

range = s1.equal_range(6);

cout<<*range.first<<" "<<*range.second<

return 0;

}

The output will be:

Reveal Solution Hide Solution
Correct Answer: C

Question #5

What happens when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) { out<

struct Add {

int operator()(int & a, int & b) {

return a+b;

}

};

int main() {

int t[]={1,2,3,4,5,6,7,8,9,10};

vector v1(t, t+10);

vector v2(10);

transform(v1.begin(), v1.end(), v2.begin(), bind1st(1,Add()));

for_each(v2.rbegin(), v2.rend(), Out(cout));cout<

return 0;

}

Program outputs:

Reveal Solution Hide Solution
Correct Answer: E


Unlock all CPP - C++ Certified Professional Programmer Exam Questions with Advanced Practice Test Features:
  • Select Question Types you want
  • Set your Desired Pass Percentage
  • Allocate Time (Hours : Minutes)
  • Create Multiple Practice tests with Limited Questions
  • Customer Support
Get Full Access Now
Disscuss C++ Institute CPP - C++ Certified Professional Programmer Topics, Questions or Ask Anything Related

Save Cancel