Assignment: (Save this file as A7-1.cpp) Write a program to calculate the gross pay for an...

50.1K

Verified Solution

Question

Programming

Assignment: (Save this file as A7-1.cpp) Write a program tocalculate the gross pay for an assembly line employee that worksfor a company that pays all assembly line workers $7.50 hour. Anyemployee that works over 40 hours per week is compensated by beingpaid time-and-one-half for each hour over 40. a. Use main( ) as thedriver function. Allow the user to compute as many employees asdesired. b. Write the function getName( ) that prompts for the nameof the employee and returns it to main( ). c. Write the functiongetTime( ) that prompts the user for the time worked for that weekand returns this value back to main( ). Do not allow the user toenter a negative value for the hours. Display an error message andkeep prompting until a valid value is entered. d. Write thefunction computePay( ) that calculates the gross pay of theemployee using the time entered by the user and returns thecalculated gross pay back to main( ). e. Write the functiondisplayPay( ) that takes as input the employee’s name, the grosspay and time worked from main( ) and displays these values.

Answer & Explanation Solved by verified expert
4.5 Ratings (662 Votes)
ANSWERI have provided the properly commentedand indentedcode so you can easily copy the code as well as check for    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students