Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A company pays its employees a weekly salary based on the number of working hours per week as it follows: fixed hourly wage for

  

A company pays its employees a weekly salary based on the number of working hours per week as it follows: fixed hourly wage for up to the first 40 hours they work and "time-and-a-half"-1.5 times their hourly wage-for overtime hours worked. Write a C++ program to compute the weekly pay for each employee. You do not know the number of employees in advance. The program asks the user to input the number of employees, then for each employee the user should input the number of hours worked for that week. Display the weekly pay as a fixed decimal with three digits of precision. In addition, the program should print the maximum salary paid for an employee for that week. Sample Input/Output Enter the number of employees: 3 Enter number of hours worked by employee 1: 38 Enter hourly rate of the employee number 1: 100 weekly salary of employee number 1 is Dirhams 3800.000 Enter number of hours worked by employee 2: 42 Enter hourly rate of the employee number 2: 50 weekly salary of employee number 2 is Dirhams 2150.000 Enter number of hours worked by employee 3: 46 Enter hourly rate of the employee number 3: 100 weekly salary of employee number 3 is Dirhams 4900.000 the maximum salary that has been paid this week is 4900.000 to employee number 3 Enter the number of employees: 2 Enter number of hours worked by employee 1: 5 Enter hourly rate of the employee number 1: 220 weekly salary of employee number 1 is Dirhams 1100.000 Enter number of hours worked by employee 2: 50 Enter hourly rate of the employee number 2: 18 weekly salary of employee number 2 is Dirhams 990.000 the maximum salary that has been paid this week is 1100.000 to employee number 1

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Quantitative Methods For Business

Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey Cam

11th Edition

978-0324651812, 324651813, 978-0324651751

More Books

Students also viewed these Electrical Engineering questions

Question

Factor each trinomial. 4(m 5)2 4(m 5) 15

Answered: 1 week ago

Question

How does cultural meaning influence the consumption process?

Answered: 1 week ago