Free CPA – C++ Certified Associate Programmer Practice Test Question

Free demo downloads

Loading demo links...

Showing 4–6 of 15 questions

Question 4 (Volume B)

What is not inherited from the base class?

Select all that apply, then click Submit answer.

  • ○

    constructor

  • ○

    destructor

  • ○

    operator=()

  • ○

    operator+()

Question 5 (Volume B)

Which of the following structures are correct?

1:

struct s1{

int x;

char c;

};

2:

struct s2{

float f;

struct s2 *s;

};

3:

struct s3{

float f;

in i;

}

Select all that apply, then click Submit answer.

  • ○

    1

  • ○

    2

  • ○

    3

  • ○

    All of these

Question 6 (Volume A)

Point out an error in the program.

#include

using namespace std;

int main()

{

char s1[] = "Hello";

char s2[] = "world";

char *const ptr = s1;

*ptr = 'a';

ptr = s2;

return 0;

}

Select all that apply, then click Submit answer.

  • ○

    No error

  • ○

    Cannot modify a const object

  • ○

    Compilation error at line 9

  • ○

    None of these