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

  Create three exception classes named numberhighexception

create three exception classes named NumberHighException, NumberLowException, and NumberNegativeException. Both NumberHighException and NumberLowException should be directly subclassed from the Exception class, but NumberNegativeException should b..

  Statements to find array elements are null or not

Write down statements needed to find whether any of the array elements are null or refer to the empty String. Set the variable hasEmpty to true.

  Write methods which display variables assigned values

write methods which display variables assigned values and operators results

  Program to retrieve records based on last name-first name

Customer service representatives wish to be able to retrieve records based on Last Name + First Name, Product Number, or State fields. Write down steps involved in your analysis of this problem?

  Develop pseudo-code for program to retrieve bytes

Develop the pseudo-code for a program that will retrieve 2 bytes (NUM1 and NUM2) from memory, determine which is closest to the numeric value 50.

  Website for a labview program

A Labview program that measures a lot of different things such as voltage, current , temperature , watt, etc - you need to have a website that displays these data for an easier access.

  Create program in visual studio-produce summary of ammounts

Create the program in Visual Studio, C#, 3.5 .Net that will produce the summary of amounts due for Pat's Auto Repair Shop. Display splash screen first.

  Compute and display number of miles per hour

Once correct data has been entered, the program muts compute and display number of miles per hour over the speed limit that the driver was doing.

  Identify differences between web design and oops

Identify two differences between web design and object-oriented programming, and explain the limitations of HTML and why XML was developed.

  Direction and magnitude be integers or doubles

Design the program consider Will the direction and magnitude be integers or doubles - will the input vectors be passed by value, by reference, or by const reference?

  Develop class templates for administrative employees

Develop classes or class templates for the following: Administrative Employees are paid a salary, but they also receive a bonus at regular intervals during the year. Add a class "Administrator" to the Employee class hierarchy.

  Program-function definition which has three int arguments

Your program will include a function definition that has three int arguments consisting of the whole dollar portion of the price and the two integers that make up the fraction part.

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