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
You have read about the beginnings of the Internet and how it was created. What was the Internet originally created to do? (sele
svlad2 [7]
Communicate and share documents.
8 0
4 years ago
Read 2 more answers
Write a program that will add the content of two counters every 45 seconds and place the result in an integer register.
nexus9112 [7]

Answer:

Explanation:

The following code is written in Java and runs a thread every 45 seconds that adds the two counters together and saves them in an integer variable called register. Then prints the variable. If this code runs 5 times it automatically breaks the loop. This can be changed or removed by removing the breakLoopCounter variable.

 public static void add_Counters(int counterOne, int counterTwo) {

       int register = 0;

       int breakLoopCounter = 0;

       try {

           while (true) {

               register += counterOne + counterTwo;

               System.out.println(register);

               Thread.sleep(45000);

               breakLoopCounter += 1;

               if (breakLoopCounter == 5) {

                   break;

               }

           }

       } catch (InterruptedException e) {

           e.printStackTrace();

       }

   }

5 0
3 years ago
he wide range of materials used to create the Buk (mask) of the Torres Strait has been interpreted as evidence of the islanders'
Kamila [148]

Answer:

The wide range of materials used to create the Buk (mask) of the Torres Strait has been interpreted as evidence of the islanders' far-reaching trade networks

C preference for local natural resources

Explanation:

The Buk (mask) aged middle to late 19th century C.E., was located in Australia, Mabuiag Island, Queensland, Torres Strait, which is between Australia and Papua New Guinea with many small mostly uninhabited islands around. Archaeological excavations show people´s  arrival at  Mabuiag islands around 7,300 years ago, being very dependent on ocean´s products to survival.

Few surviving pieces, made out of local resources materials such as turtle shell, wood, fiber, cassowary feathers, resin and paint, tell us feathers were a throughoutly artistic material used in Oceania , but  turtle shells masks were Torres Strait´s people hand-crafted and unique hallmark to be used during assorted ceremonies.

7 0
3 years ago
The first step in the information processing cycle is _____, which involves entering data into the computer.
Dmitry [639]

Answer:

INPUT

Explanation:

Information Processing Cycle is defined as the series of stages followed in processing information. Those stages include:

  • Input
  • Processing
  • Storage
  • Output

Input involve entering the data/information into the computer

Processing involve the computer performing some computation on the data

Storage involve saving the data and/or result to the any medium for future use.

Output involve displaying or presenting the results to the user.

4 0
3 years ago
Susan is troubleshooting a problem with a computer's network cabling. At which layer of the Open Systems Interconnection (OSI) R
Alisiya [41]

Answer:

Physical layer

Explanation:

The physical layer is responsible for the physical cable or wireless connection.

6 0
3 years ago
Other questions:
  • Point mode allows you to select cells for use in a formula by using your finger or the pointer
    7·1 answer
  • Arpanet was developed by the united states so that there was a communication network that would survive a nuclear war. True or F
    11·1 answer
  • The extension name of a java bytecode file is ________.
    8·1 answer
  • The program has a compilation error because s is not initialized, but it is referenced in the println statement. The program has
    8·1 answer
  • Which process best describes how you might prepare to apply for a job?
    10·2 answers
  • Instructions:Select the correct answer.
    15·1 answer
  • Rosa has received reports by several users that one of the Linux servers is no longer accessible. She is able to remote into the
    10·1 answer
  • What are the possible consequences of plagiarism?
    15·1 answer
  • 1. Who is known as the father of a computer?​
    12·2 answers
  • Why does rating an incorrect answer as 1 star raise its score on brainly?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!