How do do employee salary calcualtion using visual studio

haseena firdous 5 Reputation points
2023-03-13T06:48:48.03+00:00

Screenshot_2023-03-13-10-37-12-41_77aeb73a0a22f162ae11197ef29cc2b5

Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Aryan soni 5 Reputation points
    2023-03-13T09:07:15.4+00:00
    // Define variables
    double hourlyWage = 15.50;
    int hoursWorked = 40;
    double overtimeRate = 1.5;
    int overtimeThreshold = 40;
    double salary = 0;
    
    // Calculate salary
    if (hoursWorked <= overtimeThreshold)
    {
        salary = hourlyWage * hoursWorked;
    }
    else
    {
        int overtimeHours = hoursWorked - overtimeThreshold;
        salary = (hourlyWage * overtimeThreshold) + (overtimeHours * overtimeRate * hourlyWage);
    }
    
    
    
     hope this helps 
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.