Question 51

What happens when you attempt to compile and run the following code?
#include <iostream>
#include <string>
using namespace std;
struct Person {
string name;
int age;
};
class First
{
Person *person;
public:
First() {person = new Person;
person->name = "John";
person->age = 30;
}
void Print(){
cout<<person->name << " "<< person->age;
}
};
int main()
{
First t[2];
for (int i=0; i<2; i++)
t[i].Print();
}
  • Question 52

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    class A
    {
    public:
    void Print(){ cout<<"A";}
    };
    class B:public A
    {
    public:
    virtual void Print(){ cout<< "B";}
    };
    int main()
    {
    A *obj;
    A ob1;
    obj = &ob1;
    obj?>Print();
    B ob2;
    obj = &ob2;
    obj?>Print();
    }
  • Question 53

    What is the output of the program?
    #include <iostream>
    #include <string>
    using namespace std;
    int main()
    {
    string s1="Hello";
    string s2="World";
    s1+=s2;
    cout << s1;
    return( 0 );
    }
  • Question 54

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    int main()
    {
    int x,y=10;
    float f;
    f = 5.90;
    cout << f << ", ";
    x=f;
    cout << x <<", ";
    f=y;
    cout << f;
    return 0;
    }
  • Question 55

    What happens if character 3 is entered as input?
    #include <iostream>
    using namespace std;
    class A {
    public:
    int i;
    };
    int main () {
    int c;
    A obj;
    obj.i = 5;
    cin >> c;
    try
    {
    switch (c)
    {
    case A: throw 20;
    case B: throw 5.2f;
    case C: throw obj;
    default: cout<<"No exception";
    }
    }
    catch (int e)
    { cout << "int exception. Exception Nr. " << e; }
    catch (A e)
    { cout << "object exception. Exception Nr. " << e.i; }
    catch (...)
    { cout << "An exception occurred."; }
    return 0;
    }
  • Premium Bundle

    Newest CPA Exam PDF Dumps shared by BraindumpsPass.com for Helping Passing CPA Exam! BraindumpsPass.com now offer the updated CPA exam dumps, the BraindumpsPass.com CPA exam questions have been updated and answers have been corrected get the latest BraindumpsPass.com CPA pdf dumps with Exam Engine here:

    (220 Q&As Dumps, 40%OFF Special Discount: Exam-Tests)
    Other Version
    5444C++Institute.CPA.v2022-06-22.q125
    Latest Upload
    174EMC.D-AV-DY-23.v2026-12-03.q139
    135Cisco.350-101.v2026-12-03.q78
    233Nutanix.NCP-DB.v2026-12-02.q164
    148Huawei.H19-110_V2.0.v2026-12-02.q44
    241EXIN.ITILFNDv4.v2026-12-01.q148
    245VMware.2V0-13.25.v2026-12-01.q134
    163IBABC.CAIB-3.v2026-12-01.q17
    197Oracle.1Z1-136.v2026-11-30.q47
    288Salesforce.Nonprofit-Cloud-Consultant.v2026-11-30.q181
    341ISACA.COBIT-2019.v2026-11-30.q215