Download C++ Institute.CPA.ActualTests.2019-03-15.132q.tqb

Vendor: C++ Institute
Exam Code: CPA
Exam Name: C++ Certified Associate Programmer
Date: Mar 15, 2019
File Size: 1 MB

Demo Questions

Question 1
What will the variable "age" be in class B? 
    class A { 
            int x; 
    protected:
            int y; 
    public:
            int age; 
            A () { age=5; }; 
    };     
     
    class B : public A {
            string name; 
    public:
            B () { name="Bob"; }; 
            void Print() { 
                cout << name << age; 
            } 
    };
  1. public
  2. private
  3. protected
  4. None of these
Correct answer: A
Question 2
What happens when you attempt to compile and run the following code? 
    #include <iostream> 
    #include <string>     
     
    using namespace std;     
     
    class complex{ 
        double re, im; 
    public:
        complex() : re(1),im(0.4) 
        complex operator(complex &t); 
        void Print() { cout << re << " " << im; } 
    } 
    complex complex::operator (complex &t){
            complex temp; 
        temp.re = this>re t.re; 
        temp.im = this>im  t.im; 
            return temp; 
    }     
     
    int main(){ 
        complex c1,c2,c3; 
            c3 = c1 c2; 
            c3.Print(); 
    }
  1. It prints: 1 0.4
  2. It prints: 2 0.8
  3. It prints: 0 0
  4. It prints: 1 0.8
Correct answer: C
Question 3
What happens when you attempt to compile and run the following code? 
            #include <iostream> 
            using namespace std; 
            class complex{ 
               double re; 
               double im; 
            public:
               complex() : re(0),im(0) 
               complex(double x) { re=x,im=x;}; 
               complex(double x,double y) { re=x,im=y;} 
               void print() { cout << re << " " << im;}     
            }; 
        
            int main(){ 
               complex c1; 
               c1 = 3.0; 
               c1.print(); 
                     return 0; 
            }
  1. It prints: 0 0
  2. It prints: 1 1
  3. It prints: 3 3
  4. Compilation error
Correct answer: C
EXAM SIMULATOR

How to Open TQB Files?

Use Taurus Exam Simulator to open TQB files

Taurus Exam Simulator


Taurus Exam Simulator for Windows/macOS/Linus

Download

Taurus Exam Studio
Enjoy a 20% discount on Taurus Exam Studio!

You now have the chance to acquire Exam Studio at a discounted rate of 20%.

Get Now!
-->