Ask Question
2 June, 20:54

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)

+5
Answers (1)
  1. 2 June, 22:24
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers