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

Question 1: Given the declaration: class myClass { public: void print(); int y;

ID: 3557695 • Letter: Q

Question

Question 1: Given the declaration:

class myClass {
public:
     void print();
     int y;
private:
     int x;
};
myClass myObject;

which statement is legal?

       myObject.x = 10;
       myClass.x = 10;
       myObject.y = 10;
       myClass.y = 10;









Question 2: Which of the following class definitions is correct in C++?

(i)
class student
{
public:
     void student();
     void student(string s, double g, int i);
     void set(string s, double g, int i);
     void print();
private:
     string name;
     double gpa;
     int id;
};

(ii)
class student
{
public:
     student();
     student(string s, double g, int i);
     void set(string s, double g, int i);
     void print();
private:
     string name;
     double gpa;
     int id;
};        Only (i)
       Only (ii)
       Both (i) and (ii)
       None of these

Explanation / Answer

1)iii
2)ii
3)iii
4)i
5)iii
6)iii
7)iii
8)iii
9)iii
10)i

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