Print out the list of employees identifying them by index

Assignment Help Programming Languages
Reference no: EM13950490

Company weekly payroll. The input will be a list of hours worked by employees. The output will be the list of amounts owed to each employee plus a total sum of the amounts owed.

Use two methods that work with arrays that contain the payroll data. The first method, which will be called getPayrollData(), will be called from main() in order to get the payroll data from the user. It must do the following:

Prompt the user for the number of employees to be processed.
Create an array of the size needed to hold the hours worked for this many employees. This should be an array of int since the company requires that full hours be worked.

Input the hours worked into the array using a loop and identifying employees as described further down.

Pass the array back to main() as the return value of the method.
You will create a second method called processPayroll() that returns an array of doubles. It will take the hours worked array as a parameter and process it. This method must do the following:

Receive the array from main() as a parameter.

Create a new array of doubles to hold the wages information for each employee. This second wages array will have to be the same size as the hours worked array.

Process the data elements by calculating the wages owed to the employee for the number of hours worked and loading this data into the corresponding element of the wages array. The calculation of wages will be done at a fixed pay rate of $38.57/hour with time and a half for over time where over time is any number of hours worked in excess of 40 hours.
Return the wages array.

When processPayroll() returns to main() the code in main() will do two things:

Print out the list of employees identifying them by the array index as described below, how many hours were worked, and and how much is owed to each one.

Print out the sum total of money owed by the company for the payroll.
To make it simple to associate employees to array elements we will assume that the company identifies employees by a payroll number. This number conveniently begins with 100 for the first employee and counts up from there. So you can just add 100 to the array index for the particular employee to display the employee number. You must show the employee number during the input process by prompting for the hours worked by that employee number. You must also print the employee number when displaying the output list of amounts owed to each employee. This means that data for employee #100 is in array location 0, #101 in array location 1, etc.

The input/output format must duplicate the format shown in the sample run below. The user inputs are shown in blue text. You must use printf() to make the amounts in dollars print with two decimal places of accuracy.

Enter number of employees: 4
Enter below the hours worked for the employee number:
#100: 40
#101: 43
#102: 37
#103: 40

Payroll Report:

Emp Number Hours Wages($)
---------- ----- ---------

100 40 1542.80
101 43 1716.37
102 37 1427.09
103 40 1542.80

Total wages: $6229.06

Attachment:- Payroll.zip

Reference no: EM13950490

Questions Cloud

Prepare journal entries to record the given inventory : Prepare journal entries to record the above inventory and the following events related to the estate principal and income: Final medical and funeral expenses of $22,000 are paid.
Determine the indicated property : Using the appropriate table, determine the indicated property. In each case, locate the state by hand on sketches of the T-y and T-s diagrams.
Explain the importance of active listening in the workplace : Write a 700- to 1,050 word essay in which you do the following: Explain the importance of active listening in the workplace. Explain how supportive and defensive climates can improve relations in the workplace
What is the effect of an increase in fixed costs : What is the effect of an increase in fixed costs of $5000 on equilibrium price and output?
Print out the list of employees identifying them by index : The input/output format must duplicate the format shown in the sample run below. The user inputs are shown in blue text. You must use printf() to make the amounts in dollars print with two decimal places of accuracy.
Determine the specific entropy at indicated states : Using the tables for water, determine the specific entropy at the indicated states, in Btu/lb ? 8R In each case, locate the state by hand on a sketch of the T-s diagram.
Describe principles of verbal and nonverbal communication : Write a 350- to 700-word memo to your employees in which you do the following: Describe the principles of verbal and nonverbal communication
Develop an estate plan for wagners that would minimize taxes : Develop an estate plan for the Wagners that would minimize estate taxes and incorporate the above factors. The uni?ed transfer tax rates and the 2009 exclusion amounts set forth in the text should be used.
Gain specific knowledge about the marketing activities : Visit any retail establishment of your choice in order to gain specific knowledge about the marketing activities of the operation. Provide a 2-3 page report on your visit using at least two references (one reference to be the textbook) to support ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd