1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yulyashka [42]
4 years ago
10

Write a program to process weekly employee time cards for all employees of an organization. Each employee will have three data i

tems: an identification number, the hourly wage rate, and the number of hours worked during a given week. Each employee is to be paid time and a half for all hours worked over 40. A tax amount of 3.625 percent of gross salary will be deducted. The program output should show the employee’s number and net pay. Display the total payroll and the average amount paid.
Computers and Technology
1 answer:
Naddika [18.5K]4 years ago
5 0

Answer:

The cpp program for the scenario is shown.

#include <iostream>

using namespace std;

 int main() {

 

     int count;

     int empNum[count];

     double work_hrs[count];

     double hrly_wage[count];

     double ot_wage[count];

     double hour = 40.00;

     double gross_pay[count];

     double tax=3.625;

     double total_pay = 0, avg_pay;

     

   

   cout<<"Enter the number of employees "<<endl;

   cin>>count;

   cout<<"Enter the details for the employees "<<endl;

   

   int i=0;

   

   while(i<count)

   {

       cout<<"Enter the id"<<endl;

       cin>>empNum[i];  

       

       cout<<"Enter the working hours"<<endl;

       cin>>work_hrs[i];

       

       cout<<"Enter the hourly pay"<<endl;

       cin>>hrly_wage[i];

       ot_wage[i] = hrly_wage[i]*1.5;

       

       i++;

       

   }

   

   cout<<"The payroll for the employees "<<endl;

   

   i=0;

   

   while(i<count)

   {

       if(work_hrs[i] > hour)

           gross_pay[i] = ( hour*hrly_wage[i] );

       else

           gross_pay[i] = ( hrly_wage[i]*work_hrs[i] );

       

       if(work_hrs[i] > hour)

           gross_pay[i] = gross_pay[i] + ( (work_hrs[i]-hour)*ot_wage[i] );

           

       gross_pay[i] = gross_pay[i]-( (gross_pay[i]*tax)/100 );

       

       total_pay = total_pay + gross_pay[i];

       i++;

       

   }

   

   avg_pay = total_pay/count;

   i=0;

   

   while(i<count)

   {

       cout<<"Gross pay of employee "<<empNum[i]<<" : "<<gross_pay[i]<<endl;

   

       i++;

   }

   cout<<"Average amount paid to all employees is "<<avg_pay<<endl;

   

   return 0;

 }

OUTPUT

Enter the number of employees                                                                                                                

2                                                                                                                                            

Enter the details for the employees                                                                                                    

Enter the id                                                                                                                                  

111                                                                                                                                          

Enter the working hours                                                                                                                      

46                                                                                                                                            

Enter the hourly pay                                                                                                                          

12                                                                                                                                            

Enter the id                                                                                                                                  

222                                                                                                                                          

Enter the working hours                                                                                                                      

50                                                                                                                                            

Enter the hourly pay                                                                                                                          

14                                                                                                                                            

The payroll for the employees                                                                                                          

Gross pay of employee 111 : 566.685                                                                                                          

Gross pay of employee 222 : 742.087                                                                                                          

Average amount paid to all employees is 654.386                                                                                              

Explanation:

1. User enters the number of employees.

2. User enters all pieces of information including identification number, hourly wage rate and number of hours worked.

3. Inside a while loop, user input is taken in the arrays.

4. Inside another while loop, the gross pay of each employee is computed. The gross pay of each employee is added to the variable, total_pay.

5. The value of the variable, avg_pay, is computed outside the loop.

6. All the while loops work over variable i till the value of i becomes 1 less than count.

7. The value of the variable, i, is made 0 before the loop begins.

8. The employee number and the gross pay of each employee is displayed followed by the average pay.

You might be interested in
What are the major functions of a computer
murzikaleks [220]
A computer is a device whose main function is to process large amounts of information quickly and accurately, and this procedure is done thanks to hardware and software.
7 0
4 years ago
What are the elements of a good study environment? Check all that apply.
finlep [7]

The elements of a good study environment are that it must be well lit the resources are near it is quite and it is clutter free

Explanation:

A good study environment must be an environment that will promote the good study conditions and it must be quite and calm if a person studies in that environment all the resources like the food water and the other refreshments must be available in that environment

The environment must be clean and it must be clutter free without any disturbances and hence these are the factors that will promote the good study environment

3 0
3 years ago
Read 2 more answers
What is used to configure data sources for applications that require access to a database?
Radda [10]
A network is used to configure data sources for applications that require access to a database?
6 0
4 years ago
A developer wants to take existing code written by another person and add some features specific to their needs. Which of the fo
anzhelika [568]

Answer:

open-source

Explanation:

open-souce software allows any user to submit modifications of the source code

7 0
3 years ago
To accomplish a certain task when you would rsther be doing something else is an example of
fenix001 [56]

Answer:

Self Discipline

Explanation:

his is because you train your brain to do the right thing.

I hope I helped. Thank you for your time.

6 0
3 years ago
Other questions:
  • How many buttons does a gamecube controller have?
    7·1 answer
  • Which of the given original work is protected by the copyright law
    9·1 answer
  • When you purchase software in a box, reading the ________ is important to know if the software will function properly?
    13·1 answer
  • Why does a thermostat blade bend when heated or cooled?
    9·1 answer
  • What are the 2 things you are not sure about evaluating functions​
    7·2 answers
  • Many commercial encryption programs use a technology called ____, which is designed to recover encrypted data if users forget th
    12·1 answer
  • Remember partially filled arrays where the number of elements stored in the array can be less than its capacity (the maximum num
    14·1 answer
  • As marketing manager, you need to have ( blank) skills and (blank) skills.
    11·1 answer
  • There are several design goals in building an operating system; for example, resource utilization, timeliness, robustness and so
    11·1 answer
  • A computer program that enables users to create and work with files and folders is called what?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!