Question: Q3) Find the errors of the following code, and explain why? (5 points) #include AxyAAx=a;xO_(4)y+=3;=>(1,2);=>A class A ) { y+=3; void print is a

Q3) Find the errors of the following code, and explain why? (5 points)\ #include

AxyAAx=a;xO_(4)y+=3;=>(1,2);=>A\ class A

)

\ { y+=3; void print is a censhant function can not modify Data

}

\

{

} display (): =>\ Void print is a constrat funcrian and display () non constant coutA is a class in itialize one variable and object 1 has atwo variable. const A object2(1);\

{

} object2.displayx():\ object\ (2) is a consiant object and display x() is a non constant function and constant object can not call non constant function.
 Q3) Find the errors of the following code, and explain why?

Q3) Find the errors of the following code, and explain why? (5 points) \#include h > class A public: const int X; int y; Jalue and aconstructor no return 1 void A (int a) error because A aconstructor Jalue and dont writing Void 1 x=a erif because x is a constant function and constant function cannat modify Oum void display () \{cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!