Lesson 17 of 24

Inheritance

10 min 35 XP

class Car : public Vehicle দিলে Car পায় Vehicle-এর public ও protected members। Derived constructor তার initializer list-এ base constructor call করে। C++ multiple inheritance-ও সমর্থন করে।

Example: edit me and press Run

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.

Challenge

+35 XP

Base class Employee (name, salary, salary ফেরত দেওয়া double pay()) এবং অতিরিক্ত bonus সহ salary + bonus ফেরত দেওয়া payWithBonus()-যুক্ত Manager : public Employee লিখুন। main()-এ name, salary ও bonus পড়ে print করুন: Input: Ravi 50000 7500 Output: Ravi base pay: 50000 Ravi total pay: 57500

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.