Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions