C program using multiple functions to calculate gross salary, homework help

Jun 28th, 2016
SKTFaker
Category:
Other
Price: $5 USD

Question description

Write a C program using multiple functions that will calculate the gross pay for a set of employees

The program determines the overtime hours (anything over 40 hours), the gross pay and then outputs a table in the following format. Column alignment, leading zeros in Clock number, and zero suppression in float fields is important. Use 1.5 as the overtime pay factor.

-----------------------------------------------
  Clock#  Wage  Hours  OT  Gross
-----------------------------------------------
  098401  10.60  51.0  11.0  598.90
  526488  9.75  42.5  2.5  426.56
  765349  10.50  37.0  0.0  388.50
  034645  12.25  45.0  5.0  581.88
  127615  8.35  0.0  0.0  0.00


Use the following information to initialize your data.

  98401  10.60 
  526488  9.75
  765349  10.50
  34645  12.25
  127615  8.35


You should implement this program using one array for clock number, one array for wage rate, etc.

Limit your use of global variables - Learn how to pass parameters!
Remember to use constants and all the other things we have covered up to this assignment
Re-read the homework standards ... make sure that each local variable is commented in EACH function, and EACH function has a descriptive function comment header
As a challenge, you can have your program prompt the user to enter the number of hours each employee worked. When prompted, key in the hours shown below.  If you wish to just use a constant for array size and predefine clock and wage values into arrays, that is acceptable.

Do define your array size up front in your variable declaration.  Don't define the array size at run time with a variable.  This strategy does not always work on every C compiler.

Create a separate function whenever possible to break up your program. For instance, you might have a function for obtaining the hours from the user, another function for calculating overtime hours, another for calculating gross pay and another function for producing the output.  At a minimum, you should have a main function and three or more other functions.

 

 


 

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UIUC
PREMIUM TUTOR

Your code is done. I used more than 3 functions and it is produ...

Studypool has helped 1,244,100 students

7 Reviews


Summary
Quality
Communication
On Time
Value
kpcutie
Dec 4th, 2016
" Excellent job "
Hemapathy
Nov 20th, 2016
" all I can say is wow very fast work, great work thanks "
BlueOcean
Nov 7th, 2016
" Awesome! Exactly what I wanted. "
kevin12622
Oct 29th, 2016
" Goes above and beyond expectations ! "
ashleyisgod
Oct 15th, 2016
" Top quality work from this guy! I'll be back! "
likeplum4
Oct 6th, 2016
" Excellent work as usual "
Molly_Moon
Sep 23rd, 2016
" AMAZING as always! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1820 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors