Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,134 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
// 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