For Business
Login
Home
Assessments
Mytat Certificates
Community
Courses
Premium Courses
jobs
Practice
Upskilling
Projects
Help
Run >>
PHP
Visual Basic.Net
SQL (SQLite 3.27.2)
Scala
Rust
Ruby
R
Python for ML
Python (3.8.1)
Python (2.7.17)
Perl (5.28.1)
C (GCC 9.2.0)
C#
C++ (GCC 9.2.0)
Go
Groovy (3.0.3)
Java
JavaScript / Node.js
Kotlin
Lua
Objective-C
#include
using namespace std; // Base class class Employee { protected: // Protected access specifier int salary; }; // Derived class class Programmer: public Employee { public: int bonus; void setSalary(int s) { salary = s; } int getSalary() { return salary; } }; int main() { Programmer myObj; myObj.setSalary(50000); myObj.bonus = 15000; cout << "Salary: " << myObj.getSalary() << "\n"; cout << "Bonus: " << myObj.bonus << "\n"; return 0; }