Ask Question
6 April, 11:29

The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate-up to 40 hours; any hours worked beyond 40 are paid at time-and-a-half (one and a half times the hourly rate). given the variables hours, rate, and pay have already been declared and assigned values, write a fragment of code (one or more statements) that assigns to pay the proper value, taking into account time-and-a-half. (basic arithmetic, basic conditional)

+4
Answers (1)
  1. 6 April, 13:16
    0
    C# program code;

    if (hours <=40)

    {

    pay = rate * hours;

    }

    else

    {

    extra_hours = hours - 40;

    pay = 40*rate + extra_hours * rate*1,5;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate-up to 40 hours; any hours worked beyond 40 are ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers