Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ABC Corporations Pvt Ltd wants to build a sales organization where each executive manages two subordinates with an efficient budget. The Managing Director plans to reward the line with the highest sales with a bonus, split into budget efficiency and sales efficiency portions. The bonus is 3 million Rupees, with 25% based on budget efficiency (subordinates managed) and 75% based on individual sales. Write a program to identify the line with the highest sales and distribute bonuses accordingly.
- Organizational Structure:
- - Sales executives (SE1 to SE17) manage sales in millions of INR.
- Program Objective:
- - Identify the line with the highest sales.
- - Distribute bonuses:
- - 25% based on budget efficiency (number of subordinates managed).
- - 75% based on individual sales performance.
- Example:
- - List the line with the highest sales.
- - Distribute bonuses to executives based on budget and sales efficiency.
- Problem Statement:
- ABC Corporations Pvt Ltd wants to reward the sales organization line that achieved the highest sales in the year. The reward distribution is based on budget efficiency and sales figures. Each sales executive manages two subordinates from top to bottom with an efficient budget. If there isn't enough budget for two people, only one person can be hired at any level.
- Approach:
- 1. Calculate the total sales handled by each sales executive.
- 2. Determine the organization line with the highest total sales.
- 3. For the chosen line:
- - Distribute 25% of the bonus based on budget efficiency.
- - Distribute 75% of the bonus based on individual sales figures.
- 4. Output the organization line with the highest sales and the bonus distribution for each member.
- JavaScript Code Snippet Solution:
- ```javascript
- // Sales data representing millions in INR handled by each sales executive
- const salesData = {
- SE1: 10,
- SE2: 8,
- SE3: 7,
- SE4: 9,
- SE5: 11,
- SE6: 7,
- SE7: 8,
- SE8: 6,
- SE9: 10,
- SE10: 5,
- SE11: 7,
- SE12: 6,
- SE13: 9,
- SE14: 5,
- SE15: 6,
- SE16: 8,
- SE17: 4
- };
- // Calculate total sales for each sales executive
- const totalSales = Object.values(salesData).reduce((acc, cur) => acc + cur, 0);
- // Determine the organization line with the highest total sales
- const highestSalesLine = Object.keys(salesData).filter(se => salesData[se] === Math.max(...Object.values(salesData)));
- // Output the organization line with the highest sales
- console.log('Organization Line with the Highest Sales:', highestSalesLine);
- // Individual bonus distribution for the chosen line
- const bonus = 3000000; // Total bonus amount
- const budgetEfficiencyReward = 0.25 * bonus; // 25% of bonus for budget efficiency
- const salesEfficiencyReward = 0.75 * bonus; // 75% of bonus for sales efficiency
- // Number of subordinates managed by each sales executive
- const subordinates = {
- SE1: 5,
- SE2: 4,
- SE5: 3,
- SE9: 2,
- SE16: 1,
- SE17: 0
- };
- // Calculate budget efficiency reward distribution
- const budgetEfficiencyBonus = highestSalesLine.reduce((acc, se) => {
- return acc + (subordinates[se] / Object.values(subordinates).reduce((acc, cur) => acc + cur, 0)) * budgetEfficiencyReward;
- }, 0);
- // Calculate sales efficiency reward distribution
- const salesEfficiencyBonus = highestSalesLine.reduce((acc, se) => {
- return acc + (salesData[se] / totalSales) * salesEfficiencyReward;
- }, 0);
- // Output bonus distribution
- console.log('Budget Efficiency Reward Distribution:', budgetEfficiencyBonus);
- console.log('Sales Efficiency Reward Distribution:', salesEfficiencyBonus);
- ```
- This solution first calculates the total sales for each sales executive, determines the organization line with the highest sales, and then calculates the bonus distribution for that line based on budget efficiency and sales figures. Finally, it outputs the organization line with the highest sales and the bonus distribution for each member.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement