Home /
Expert Answers /
Computer Science /
wrong-answersplease-give-me-right-answer-and-solutions-suppose-class-d-inherits-from-b-suppose-we-pa680
(Solved): wrong answersplease give me right answer and solutions Suppose class D inherits from B. Suppose we ...
wrong answers
please give me right answer and solutions
Suppose class D inherits from B. Suppose we defined the following variables with appropriate initialization. B b; D d; B* pb ; D * pd; Which of the following assignments are legal? d=b; pd=pb;
class Polygon \{ int width, height; public: //member functions \} ; class Rectangle \{ friend class Polygon; int width, height; public: //member functions \}; class Square \{ friend class Rectangle; private: int side; public : // member functions \}; which of the following statements is correct (select all that apply) The member function in class can access the private member of class The member function in class can access the private member of class The member function in class can access the private member of class The member function in can access the private member of class
class Player \{ public: void set_name(string the_name); void set_salary(double the_salary); string get_name() const; double get_salary() const; void display() const; private: string name; double salary; \}; . . . class Baseballplayer : public Player \{ public: void set_home_runs(int number); double get_batting_avg() const; void display() const; private: int at_bats; int hits; int home_runs; \}; ?. . void BaseBallplayer::display() const \{ cout <<<< endl; \} Which expression can be used to complete the display() function in the BaseballPlayer class? name << " " << salary << " " << get_batting_avg() name <<""<< salary <<""<< at_bats <<""<< hits << " " << home_runs get_name() << " " << salary << " " << get_batting_avg() get_name() << " " << get_salary() << " " << get_batting_avg()