Question

Write a program in C++ to compute the salaries of Employees of an organization who are having different designations. Use Virtual Base Class or Classes. Make necessary assumptions

29 Nov 2024
Answer :
Word Count : 370

```cpp
#include <iostream>
#include <string>
using namespace std;

class Employee {
protected:
    string name;
    int id;
    double basicSalary;

public:
    Employee(string n, int i, double salary) : name(n), id(i), basicSalary(salary) {}

    virtual double calculateSalary() = 0; // pure virtual function
    void display() {
        cout << "Employee ID: " << id << endl;
        cout << "Employee Name: " << name << endl;
_____ _________ _____ ____ _____ __________.
________ ____ ___ ________ ____ ______ __________ _____ _____ ______ ____.
________ ___ _______ ______ ________.
_____ _____ ______ ____ ________ _______ ____ ______ ___ ________ _____.
___ ___ _______ ______ ____.
__________ ____ ___ ____ ________ _________.
_________ _____ ___ _______ ________ _______ ____.
____ ___ ____ _____ ________.
___ _______ __________ _______ _______ _________ __________ __________.
_________ ______ __________ __________ _______ _________ ___ ________ _____ _______.
________ ______ ____ _____ ____ ______ _______ _________ ____.
___ _____ ______ _____ ______ ______ ____ _____ ___ _____ _____.
_________ _____ ________ _______ _____ _______ ________ _______ ___ _______ _____.
______ ________ ___ _______ ___ ____.
_____ _______ _______ ________ ________ _____ _____.
_____ ______ ________ ___ ___ ______.
____ _____ _______ __________ __________ ____ _________ ___ _______ ____.
___ _________ _________ ___ ________ __________ __________ ________ _______ _____.
________ ____ ______ _________ __________ ______ ________ ________ ___ __________ __________.
________ _____ _________ ________ ____.
____ __________ ____ __________ _______ _______ __________ ______ ________ __________ _______.
___ ___ __________ _________ ______.
_________ ________ __________ _______ _____ ________.
______ ___ ________ ___ __________ _______ __________ _________.
________ ___ _________ ___ ___ _________.
___ ___ _____ _____ ________.
_______ _______ ________ ______ ________ ______ ________ ______ ____ _________ _____.
____ _______ ______ ____ _____ ____.
________ __________ _______ _______ _________ _______ ________ _____ ________ ____.
______ _________ ___ __________ __________ _____.
________ __________ _________ _________ __________ ___ _____ ______ ___ ___ _____.
__________ _________ __________ _________ _________ ________ _________ ___ ________ ______ __________ ______.
________ ___ _________ _____ _______ ______ _________ ________ ________ ________ ______.
_________ _______ _____ __________ _____ ___ _________ _______ _______ ____.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write a program in C++ to compute the salaries of Employees of an orga
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→