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.
Answer :
Word Count : 435
### Assumptions 1. Employees have a base salary, and designations add bonuses or multipliers to the base salary. 2. Designations include Manager, Developer, and Intern. 3. The program calculates the salary based on these criteria and displays the results. ```cpp #include #include using namespace std; // Base class class Employee { protected: string name; double baseSalary; public: Employee(string empName, double baseSal) : name(empName), baseSalary(baseSal) {} virtual double calculateSalary() const = 0; // Pure virtual function virtual void displaySalary() const { cout ____ ______ ____ _____ _______.
________ _______ _______ __________ _________.
___ ______ ___ ______ ______ _____ ______ ____ _______.
_________ ________ ___ __________ ________ _______.
________ _____ __________ _____ _____ _______ __________ _______ ___ ______ _______ ________.
______ _____ _____ __________ ____ ______ _______ ______ ____ _________ ________.
______ __________ _______ __________ ________ ___ ________ ____ _________ _____.
______ ____ __________ _______ _____ _____ __________ __________ _____ _____ _________.
_____ ____ _____ ____ ____ _______ ___ __________ __________ _____.
______ ________ ____ _______ _____.
_____ _____ ____ ________ _________ _______ ___ _________ ____ _______ _________.
______ _______ _______ _______ _______ _______ __________ ___ ___ ______ _______.
___ _______ _______ ________ ______.
________ ____ _________ ________ _________ ________ ___.
___ ___ ___ ____ _________ _______ _____ _______ ____ ________ __________.
____ _________ ________ ______ __________ __________ ________ ________ ______ ______.
_________ ____ _____ ________ ______ _______ ________ ______ _______ ____ __________.
_______ ___ _________ __________ __________ __________ __________ _________ _________ ________ ________.
______ _______ _______ ___ ___ ____ ___ _______ ______ ______ ______ ______.
_________ _______ ___ __________ __________ _________ _________ __________ ___.
____ _____ ____ _____ _____.
_________ ____ __________ ________ _______ _____ ___.
____ __________ _______ ________ _________ _____.
____ _____ _______ ________ ____ _______.
_________ ________ _______ _____ ___ _________ _________ _______.
______ _______ _______ ______ ___ ________ ____ ________.
__________ __________ ____ ___ _______ _______.
__________ ____ _____ ______ ________.
______ _________ _________ ______ ____ ___.
_____ ____ ____ _______ ________ ________ _________.
__________ ________ _______ __________ __________ _____ _______ ____ _________.
_______ _______ ______ __________ _______ _________ ___ ____ ____.
__________ ___ __________ _______ _______ _____ __________ _________ ___ ________.
_____ ______ __________ _______ ____ __________ ___ ____.
_______ ______ _______ ______ __________ __________ ________ _______ ______.
___ ____ ____ ________ _____ ____ ____ __________ ___.
_____ ___ __________ _________.
Skip in 10
________ _______ _______ __________ _________.
___ ______ ___ ______ ______ _____ ______ ____ _______.
_________ ________ ___ __________ ________ _______.
________ _____ __________ _____ _____ _______ __________ _______ ___ ______ _______ ________.
______ _____ _____ __________ ____ ______ _______ ______ ____ _________ ________.
______ __________ _______ __________ ________ ___ ________ ____ _________ _____.
______ ____ __________ _______ _____ _____ __________ __________ _____ _____ _________.
_____ ____ _____ ____ ____ _______ ___ __________ __________ _____.
______ ________ ____ _______ _____.
_____ _____ ____ ________ _________ _______ ___ _________ ____ _______ _________.
______ _______ _______ _______ _______ _______ __________ ___ ___ ______ _______.
___ _______ _______ ________ ______.
________ ____ _________ ________ _________ ________ ___.
___ ___ ___ ____ _________ _______ _____ _______ ____ ________ __________.
____ _________ ________ ______ __________ __________ ________ ________ ______ ______.
_________ ____ _____ ________ ______ _______ ________ ______ _______ ____ __________.
_______ ___ _________ __________ __________ __________ __________ _________ _________ ________ ________.
______ _______ _______ ___ ___ ____ ___ _______ ______ ______ ______ ______.
_________ _______ ___ __________ __________ _________ _________ __________ ___.
____ _____ ____ _____ _____.
_________ ____ __________ ________ _______ _____ ___.
____ __________ _______ ________ _________ _____.
____ _____ _______ ________ ____ _______.
_________ ________ _______ _____ ___ _________ _________ _______.
______ _______ _______ ______ ___ ________ ____ ________.
__________ __________ ____ ___ _______ _______.
__________ ____ _____ ______ ________.
______ _________ _________ ______ ____ ___.
_____ ____ ____ _______ ________ ________ _________.
__________ ________ _______ __________ __________ _____ _______ ____ _________.
_______ _______ ______ __________ _______ _________ ___ ____ ____.
__________ ___ __________ _______ _______ _____ __________ _________ ___ ________.
_____ ______ __________ _______ ____ __________ ___ ____.
_______ ______ _______ ______ __________ __________ ________ _______ ______.
___ ____ ____ ________ _____ ____ ____ __________ ___.
_____ ___ __________ _________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.
Unable to load cart.
'; });}/* ========================================================= CALCULATE TOTAL========================================================= */function calculateCartTotal() { let subtotal = 0; /* Looks for .item-price inside AJAX products. Examples accepted: ₹200 ₹200.00 Rs 200 Rs. 200 200 200.00 */ const prices = document.querySelectorAll( '#loadmycart .item-price' ); prices.forEach(function(element) { let text = element.textContent || ''; text = text .replace(/₹/g, '') .replace(/Rs\.?/gi, '') .replace(/,/g, '') .trim(); let value = parseFloat(text); if (!isNaN(value)) { subtotal += value; } }); updateCartDisplay(subtotal);}/* ========================================================= UPDATE TOTAL DISPLAY========================================================= */function updateCartDisplay(total) { const subtotalElement = document.getElementById('subtotal'); const totalElement = document.getElementById('total'); const checkoutButton = document.getElementById('checkoutButton'); const noItems = document.getElementById('noitems'); const amount = Number(total) || 0; if (subtotalElement) { subtotalElement.textContent = '₹' + amount.toFixed(2); } if (totalElement) { totalElement.textContent = '₹' + amount.toFixed(2); } /* EMPTY CART */ if (amount