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