Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

declare a class A according to the following requirements class A has two constr

ID: 3697038 • Letter: D

Question

declare a class A according to the following requirements

class A has two constructors ( one without parameters, and another with two integer parameters)

class A has two private member xx and yy with parameters

the constructors with two parameters (x and y) passes their values to two private integer members (xx and yy)

class A has deconstructor to display the object is deleted .

given the class definition

class menu

{

public:

menu() ()                                                                              //constructor 1

menu(int num, char t) : numofItems (num), tag(t) {}

// constructor 2

private:

int numberofItems;

char tag;

};

tell which definition below is legal

if legal, tell whether it is a definition of an object of class A

if the definition is illegal and defines a class A object, tell which constructor is called for each of the following definitions

menu x(2, ‘ A’);

menu x;

menu x = A(2, ‘A’);

menu x(1);

menu x( ) ;

Explanation / Answer

Answer:-

3rd definition of declaring an aobject of class A and pass the value to private member of class A is a lega value.

Yes

4th and 5th definition is declaring an object but unable to invoke the contructor value.