題組內容

Please answer the following questions. For answers in code, any programming language (but not mixed) or pseudocode is allowed.(60%)

2. In object-oriented programming (OOP), public, private and protected are common access modifiers for the members (variables and functions) in a class. They are important for inheritance. Please describe what is inheritance and the difference among public, private and protected members. (10%) Furthermore, three kinds of inberitance, public, private and protected inheritance, are in C++. Please draw a figure or table to show how public, private and protected members in the base class become in the derived class through public, private and protected inheritance. (10%)