Download ASIS.CPP.BrainDumps.2019-03-15.136q.tqb

Download Exam

File Info

Exam Certified Protection Professional
Number CPP
File Name ASIS.CPP.BrainDumps.2019-03-15.136q.tqb
Size 1 MB
Posted Mar 15, 2019
Download ASIS.CPP.BrainDumps.2019-03-15.136q.tqb

How to open VCEX & EXAM Files?

Files with VCEX & EXAM extensions can be opened by ProfExam Simulator.

Purchase

Coupon: MASTEREXAM
With discount: 20%






Demo Questions

Question 1

What happens when you attempt to compile and run the following code? 
    #include <vector> 
    #include <iostream> 
    #include <algorithm> 
    using namespace std; 
    class B { int val; 
    public:
        B(int v):val(v)
        int getV() const {return val;}  bool operator < (const B & v) const { return val<v.val;} }; 
    ostream & operator <<(ostream & out, const B & v) { out<<v.getV(); return out;} 
     
    template<class T>struct Out { 
        ostream  & out; 
        Out(ostream & o): out(o)
        void operator() (const T & val ) { out<<val<<" "; } }; 
     
    int main() { 
        B t1[]={3,2,4,1,5}; 
        B t2[]={6,10,8,7,9}; 
        vector<B> v1(10); 
        sort(t1, t1+5); 
        sort(t2, t2+5); 
        merge(t1,t1+5,t2,t2+5,v1.begin()); 
        for_each(v1.begin(), v1.end(), Out<B>(cout));cout<<endl; 
        return 0; 
    } 
Program outputs:


  1. 1 2 3 4 5 6 10 8 7 9
  2. 3 2 4 1 5 6 7 8 9 10
  3. 3 2 4 1 5 6 10 8 7 9
  4. 1 2 3 4 5 6 7 8 9 10
  5. compilation error
Correct answer: E



Question 2

What happens when you attempt to compile and run the following code? 
    #include <vector> 
    #include <iostream> 
    #include <algorithm> 
    using namespace std; 
    template<class T>struct Out { 
        ostream  & out; 
        Out(ostream & o): out(o)
        void operator() (const T & val ) { out<<val<<" "; } }; 
     
    int main() { 
        int t[]={3,2,4,1,5,10,9,7,8,6}; 
        vector<int> v1(t,t+10); 
        cout<<*max_element(v1.begin(), v1.end()); 
        return 0; 
    } 
Program outputs:


  1. 3
  2. 1
  3. 6
  4. 10
  5. compilation error
Correct answer: D



Question 3

What happens when you attempt to compile and run the following code? 
    #include <iostream> 
    #include <algorithm> 
    #include <vector> 
    #include <deque> 
    #include <set> 
    using namespace std; 
     
    void myfunction(int i) { 
        cout << " " << i; 
    } 
     
    int main() { 
        int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; 
        vector<int> v1(t, t + 10); 
        deque<int> d1(t, t + 10); 
        set<int> s1(t, t + 10); 
     
        for_each(v1.begin(), v1.end(), myfunction); // Line I 
     
        for_each(d1.begin(), d1.end(), myfunction);  // Line II 
     
        for_each(s1.begin(), s1.end(), myfunction);  // Line III 
        return 0; 
    }


  1. program outputs: 10 5 9 6 2 4 7 8 3 1 10 5 9 6 2 4 7 8 3 1 1 2 3 4 5 6 7 8 9 10
  2. program outputs: 10 5 9 6 2 4 7 8 3 1 10 5 9 6 2 4 7 8 3 1 10 5 9 6 2 4 7 8 3 1
  3. program outputs: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
  4. compilation error in line I
  5. compilation error in line III
Correct answer: A









CONNECT US

Facebook

Twitter

PROFEXAM WITH A 20% DISCOUNT

You can buy ProfExam with a 20% discount!



HOW TO OPEN VCEX FILES

Use ProfExam Simulator to open VCEX files