How do do employee salary calcualtion using visual studio

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

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

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,134 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,478 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,603 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
6,757 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Aryan soni 0 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 
    
    0 comments No comments