Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Which line(s) in the main() will generate error? Explain your answer. #include using namespace std; class classP { public: int 11-1; protected: };

   

3. Which line(s) in the main() will generate error? Explain your answer. #include using namespace std; class classP { public: int 11-1; protected: }; int 12 - 2; class classQ private classP{ public: }; int 13 = 3; class classR { protected: }; int 14 = 4; class classs public classQ, protected classR { protected: }; int 15 = 5; int main() { classP p; classQ q; class r; classs s; cout < < p.11 < < endl; cout < < p.12 < < endl; cout < < q.11 < < endl; cout < < q.12 < < endl; cout < < q.13 < < endl; cout < < r.14 < < endl; cout < < s.11 < < endl; cout < < s.12 < < endl; cout < < s.13 < < endl; cout < < s.14 < < endl; cout < < s.15 < < endl; return 0; (4 marks)

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions