Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 399 Weeks Ago, 1 Day Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Management Posted 20 Feb 2018 My Price 9.00

timesheet information

Program input

For a payroll program you would normally input the data from files, but in this first version you will input the data from the keyboard. The program input should be in 2 parts: employee master information and timesheet information.

Employee Master information

The employee master information consists of the following data:

  • employee ID number (an integer)
  • employee name (your program should handle names of up to 20 characters - may contain spaces)
  • pay rate per hour
  • number of dependents
  • type of employee (0 for union, 1 for management)

Note: Use the C++ string class for the employee name. Use a C++ struct to hold the employee master information for one employee.

Timesheet information

  • number of hours worked for the week

Assume that there are exactly 4 employees. Your program should first input the employee master information for each employee. Since we have not reviewed arrays and arrays of structs yet, you can use 4 individual structs to hold the employee master information for the 4 employees. If you are familiar with arrays, you can use an array of structs to hold the employee master information. Then use a separate loop to do the payroll processing for each employee (input the employee's hours worked and calculate their pay (see the example program dialog below).

Input validation

The input should be checked for reasonable values. If a value is not reasonable, your program should print an informative error message and ask the user to re-enter the value.

  • The following data should be positive numbers (greater than 0): employee id and pay rate.
  • The following data should be non-negative (0 or larger): number of dependents and hours worked.
  • Employee type should be 0 or 1.

Calculations

  • Gross Pay - Union members are paid their normal pay rate for the first 40 hours worked, and 1.5 times their normal pay rate for any hours worked over 40. Management employees are paid their normal pay rate for all hours worked (they are paid for overtime hours, but they are paid at their normal hourly rate).
  • Tax - All employees pay a flat 15% income tax.
  • Insurance - The company pays for insurance for the employee. Employees are required to buy insurance for their dependents at a price of $20 per dependent.
  • Net Pay is Gross Pay - Tax - Insurance.

Program output - Payroll Report

The payroll report should be output to a file. It should be in a tabular (row and column) format with each column clearly labeled with a column heading. All dollar amounts should be formatted with 2 decimal places. Note: do not use tabs between the columns - use the setw manipulator to set the column width so that you can line up columns of numbers on the decimal point. Print one line for each transaction that contains:

  • employee ID number
  • name
  • tax
  • insurance
  • gross pay
  • net pay

The final lines of the payroll report should print the total amount of gross pay and total amount of net pay for the week (the total for all employees).

Use Functions to Process Employees

Repeating the same (or similar) block of code for each of the employees is a bad idea. Write functions to do the payroll processing for one employee. Then you only have to repeat the calls to the functions. For example, you might write 3 functions: one function to input and validate the master information for one employee, one function to calculate the pay information for one employee, and one function to display the output for one employee.

Program Dialog

Your program dialog should look something like this example (user input is shown in bold).

Enter information for employee 1
Employee id: 22
Employee name:Cindy Burke
Pay rate: 15.00
Dependents: 1
Type: 0
Enter information for employee 2
Employee id: 42
Employee name:J. P. Morgan
Pay rate: 12.50
Dependents: 0
Type: 0
...
(input employee master information for last 2 employees)
...
Enter timecard information for each employee:
Hours worked for Cindy Burke: 40.0
Hours worked for J. P. Morgan: 39.5
...
(input timecard information for last 3 employees)
...

Other Requirements

  1. Global variables are variables that are declared outside any function. Do not use global variables in your programs. Declare all your variables inside functions.
  2. Use the C++ string class to represent strings in your program.
  3. You should use a struct to represent the employee master information for one employee. Note:you should NOT include Timecard information in this struct. Timecard information may change from one pay period to the next while employee master information usually does not. In other words, an employee's master information and information about a specific paycheck are 2 different things and logically should not be combined in the same struct (or object).
  4. Write the Payroll Report to a file.
  5. The employee master information should be read into individual structs (or, alternatively, an array of structs). Use a separate function to input and validate the employee master information for one employee.
  6. The timecard information (hours worked) can be a single variable.
  7. Use a separate function (or functions) to do the payroll processing for one employee. For example, you might pass one employee master struct to a function, which then inputs the hours worked and calculates and outputs the pay information for that employee.

Answers

(5)
Status NEW Posted 20 Feb 2018 09:02 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------

Not Rated(0)