Ask 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 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)

+1
Answers (1)
  1. 22 August, 21:11
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers