This question has been answered
Question

an algorithm computer science question click on image to enlarge2020-10-11 (4).png

Image transcriptions

Consider the problem below and the algorithm that has been created to solve the problem. Problem Create an algorithm that will read in an employee's pay rate and hours worked for the week. Calculate and print the grass pay for the employee Weekly gross pay is calculated as payment for regular hours worked, plus payment for overtime hours worked. Any hours worked over 40 wil be considered overtime Payment for regular hours worked is calculated as the pay rate times regular hours worked, payment for overtime hours worked is calculated as (hours worked - 40) times pay rate times 1.5. Algorithm Calculate Gross Pay Read hours worked, pay rate IF hours worked > 40 regular pay = pay rate * 40 overtime pay = (hours worked - 40) *pay rate* 1.5 gross pay = regular pay + overtime pay ELSE Gross pay = hours worked * pay rate Print gross pay END Example Desk Check Test Data Set 1: hours worked = 50, pay rate = 20 The IF condition evaluates to true Regular pay = 20 * 40 Regular pay = 000 Overtime pay = (50 -40) * 20 * 1.5 Overtime pay = (10) * 20 * 1.5 Overtime pay = 300 Gross pay = 800 + 300 Gross pay = 1100 Print Grass pay = 1100 Your Turn to Work through the Algorithm Work through the algorithm above using two separate test data sets. You determine the value of the regular pay and the pay rate variables to use in the algorithm You must not use the same variables) value as in the example I provide Show your work as in the desk check above with Test Data Set 1. Test Data Set regular pay - choose a value hours worked - choose a value Desk Check Test Data Set regular pay - choose a value hours worked - choose a value Desk Check

Answered by Expert Tutors
Step-by-step explanation
Consider the problem below and the algorithm that has been created to solve the problem. Problem Create an algorithm that will read in an employee's...
Get unstuck

252,291 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses