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

Find the syntax errors in the definitions of the following classes: a. class AA

ID: 3905673 • Letter: F

Question

Find the syntax errors in the definitions of the following classes:

a. class AA

                        {

            public:

                        void print ();

                        int sum ();

                        AA ();

                        int AA(int, int);

            private:

                        int x;

                        int y;

            };

b. class BB

                        {

                                    int one;

                                    int two;

                        public:

                                    bool equal();

                                    print();

                                    BB(int, int);

                        }

c. class CC

                        {

                        public;

                                    void set(int, int);

                                    void print();

                                    CC();

                                    CC(int, int):

bool CC(int, int):

                        private:

                                    int u;

                                    int v;

                        };

Explanation / Answer

Please find the syntax next to the line:

a. class AA

{

public:

void print ();

int sum ();

AA ();

int AA(int, int);//constructor will not have retuen type syntax error

private:

int x;

int y;

};

b. class BB

{

int one;

int two;

public:

bool equal();

print();//function should have a prototype

BB(int, int);

}//here semicolon is not there

c. class CC

{

public;//here syntax error semicoln shouls be replaced with :

void set(int, int);

void print();

CC();

CC(int, int):

bool CC(int, int)://invalid way of delcaring a constructor

private:

int u;

int v;

};

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote