10. The algorithm shown in Figure 1-13 should calculate and print the gross pay for five workers; however, some of the instructions are missing from the algorithm. Complete the algorithm. If an employee works more than 40 hours, he or she should receive time and one-half for the hours worked over 40. read the employee's name, hours worked, and pay rate calculate gross pay = hours worked times pay rate otherwise, do this: calculate regular pay = pay rate times 40 calculate overtime hours = hours worked minus 40 calculate overtime pay = calculate gross pay = end if print the employee's name and gross pay end repeat

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section1.4: Preliminary Four: Algorithms
Problem 6E: (Numerical) a. Write a set of detailed, step-by-step instructions in English to calculate the fewest...
icon
Related questions
Question
10. The algorithm shown in Figure 1-13 should calculate and print the gross pay for five
workers; however, some of the instructions are missing from the algorithm. Complete
the algorithm. If an employee works more than 40 hours, he or she should receive time
and one-half for the hours worked over 40.
read the employee's name, hours worked, and pay rate
calculate gross pay
= hours worked times pay rate
otherwise, do this:
calculate regular pay = pay rate times 40
calculate overtime hours = hours worked minus 40
calculate overtime pay =
calculate gross pay =
end if
print the employee's name and gross pay
end repeat
Transcribed Image Text:10. The algorithm shown in Figure 1-13 should calculate and print the gross pay for five workers; however, some of the instructions are missing from the algorithm. Complete the algorithm. If an employee works more than 40 hours, he or she should receive time and one-half for the hours worked over 40. read the employee's name, hours worked, and pay rate calculate gross pay = hours worked times pay rate otherwise, do this: calculate regular pay = pay rate times 40 calculate overtime hours = hours worked minus 40 calculate overtime pay = calculate gross pay = end if print the employee's name and gross pay end repeat
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning