Examine the following program. Select all line(s) which could go in "//code goes here" that would NOT cause a compiler error, or "None of these" if they would all cause a compiler error. Pay careful attention to the access modifiers. Class Plant{ public: Plant(); int leaves; protected: int roots; private: int flowers; class Fern: public Plant{}; class Fiddlehead: public Fern{ void grow() { //code goes here }; undefined leaves++; roots++; flowers++; None of these
Examine the following program. Select all line(s) which could go in "//code goes here" that would NOT cause a compiler error, or "None of these" if they would all cause a compiler error. Note the use of private inheritance. class Plant{ public: Plant(); int leaves; protected: int roots; private: int flowers; class Fern: private Plant{}; class Fiddlehead: public Fern{ }; int main(){ Fiddlehead fh; //code goes here return 0; undefined O int leaves = fh.leaves; O int roots = fh.roots; Oint flowers = fh.flowers; None of these.
Examine the following program. Select all line(s) which could go in "//code goes here" that would NOT cause a compiler e
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Examine the following program. Select all line(s) which could go in "//code goes here" that would NOT cause a compiler e
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!