Payroll program maintenance. Clearly state the grading option you have completed
ID: 3677136 • Letter: P
Question
Payroll program maintenance. Clearly state the grading option you have completed on a cover sheet with your name and the date the project is submitted for grading. Please use a large envelop with you name in the upper right hand corner.
We have an immediate need to migrate the existing payroll application from Microsoft “C” to standard GNU/Linux “C” using the “gcc” translator. Please complete this program ASAP (PDQ) or update your resume. You will be given a chance to travel and meet new people at your own expense.
Our contract with the customer specifies top-down-iterative-refinement for the design and implementation. The structure specified in the following design must be preserved or you will be terminated. Jackson’s Technique and Object Oriented Design (OOD) produce arguably cleaner solutions but you may not use them. All input must be from a text file and the report printed to a text file. Please prompt the user for the names of the input and report files at run time. Management would be really impressed if the user had a choice between specifying the names of the input and report files at the command line with your software prompting for the names if they are not specified. Highlight this code if implemented.
Sample data follows. Please process the data in L2CS2347CtlDataSp16.dat as soon as the software is operational.
Emp. No.
Given
Surname
Department
YTD
Pay Rate
Hours
12
Brooke
Tyler
Acct
110100.00
13.24
40.0
6
Kavanaugh
Sarah
Acct
66600.00
17.87
64.5
10
Fruci
Jordan
Acct
36600.00
10.00
10.0
22
Horn
John
Acct
109999.56
41.3
36.7
24
Pike
Jeremy
Acct
1358.34
16.22
53.5
13
Silva
Julian
DP
110090.00
10.00
1.0
5
Oliver
Logan
Mgt
673478.34
187.56
40.0
3
Nienburg
Dylan
Mgt
134234.34
67.42
56.2
1
Zhang
Zhache
Sales
11345.22
23.77
67.3
4
Curtis
Harrison
Sales
234.56
17.56
38.9
15
Welch
Wade
Sales
2342.34
27.86
45.6
17
Moreno
Issac
Sales
67000.00
34.23
40.0
The body of the report should consist of 4 detail lines per page exclusive of headings, department control breaks, and page control break information. Management would be impressed if dollar amounts contain commas in appropriate locations. Hint:
Report Format
Report
Header
Page
ACME Sports Inc.
“We are the best, you use the best!”
ACME
Emp# Name Dept. New YTD Gross FICA Net
12 Tyler Brooke Acct ?????.?? ????.?? ????.?? ???.??
6 Sarah Kavanaugh Acct ?????.?? ????.?? ????.?? ???.??
10 Jordan Fruci Acct ?????.?? ????.?? ????.?? ???.??
22 John Horn Acct ?????.?? ????.?? ????.?? ???.??
Page Totals: $xxxx.xx $xxxx.xx $xxx.xx
Page 1
Report
Body
ACME
Emp# Name Dept. New YTD Gross FICA Net
24 Jeremy Pike Acct ?????.?? ????.?? ????.?? ???.??
Department Totals: ttttttt.tt tttttttt.tt tttttt.tt
13 Julian Silva DP ?????.?? ???.?? ????.?? ???.??
Department Totals: ttttttt.tt tttttttt.tt tttttt.tt
5 Logan Oliver Mgt ?????.?? ????.?? ????.?? ???.??
3 Dylan Nienburg Mgt ?????.?? ????.?? ????.?? ???.??
Department Totals: ttttttt.tt tttttttt.tt tttttt.tt
Page Totals: $xxxx.xx $xxxx.xx $xxx.xx
Page 2
Additional pages in the body of the report with 4 detail lines per page with the possible exception of the last page.
Report
Trailor
-
You may add information
Report Summary
Records processed: 785
Total Gross: $yyy,yyy.yy
Total Net: $ yy,yyy.yy
Total FICA: $ yyy.yy
Page 200
Calculate the gross pay as the product of the number of hours worked and pay rate. Our policy is to pay time-and-a-half for all work in excess of 40 hours.
Our accounting department has supplied the following logic for computing FICA tax. The FICA Limit is currently $110,10000 and the FICA Rate is 7.1%.
no
yes
Ytd >= 110,100
Pay no tax
yes
no
Ytd + gross <= 110,100
Pay tax on total gross
Pay tax only on (100,100 – ytd)
In a properly drawn flow chart, all questions (contain a relational or logical operator) should be in diamonds. The light magenta text in rectangles has been substituted above for diamonds by the accounting department.
Please, we must anticipate yearly changes to the FICA Rate and FICA Limit. We desire to minimize the amount of time require from program maintenance when change occurs. At the same time we do not wish to incur the overhead or risk of asking the operator to input these values every time the program is executed. Management would prefer the values for the FICA Rate and FICA Limit to be read from a text file when the system starts.
The solution that must be migrated to the new platform (less department control breaks) follows.
Page Control Break Solution
Using Top-Down-Iterative-Refinement
Assume we do not know the number of records in the input. Each page is to contain appropriate column headings and exactly 20 detail lines per page (use 4 lines per page to test the lab) with the possible exception of the last page. The report should contain a cover page with the company name and logo. A trailer page should summarize the contents of the report. Be sure not to print page headings on a page that does not contain any detail lines. The following FICA calculations are for the purpose of demonstrating the output format, they are not accurate.
Report Format
Raw Data (sample)
Report
Header
ACME Sports Inc.
“We are the best, you use the best!”
Name Pay Rate Hrs
Adam 2.20 10.0
Bart 3.00 10.0
Betty 4.50 20.0
···
ACME
Name Gross FICA Net
Adam 22.00 1.50 $20.50
Bart 30.00 2.00 $28.00
Betty 90.00 4.50 $95.50
···
Page Totals: $485.76 $75.00 $410.76
Page 1
Report
Body
ACME
Name Gross FICA Net
Tom 20.00 2.50 $17.50
Sam 30.00 2.00 $28.00
Sara 40.00 4.50 $35.50
···
Page Totals: $500.76 $50.00 $450.00
Page 2
Additional pages in the body of the report with 20 detail lines per page with the possible exception of the last page.
Report
Trailer
Report Summary
Records processed: 785
Total gross: $4,896.72
Total FICA: $ 896.72
Total Net: $4,000.00
Page 200
Main Line Control or Driver
Generate Report
1) Perform Initialization.
2) Perform Calculate Payroll
Until EOF = “Yes”.
3) Perform Closing.
4) Stop Run.
Initialization
Calculate Payroll
Closing
1) Open (2) Files.
2) Print Cover Page
3) Print Heading 1st page
4) PK = 1 and LK = 0.
5) MaxLines = 20.
6) Set page & report totals
to 0 including:
Pgross, Pfica,Pnet,
Rgross, Rfica, Rnet
7) EOF = “No”.
8) Read RawData
At End set EOF = “Yes”.
1) If LK = MaxLines
Perform New Page.
2) Perform Calculate Gross.
3) Perform Calculate FICA
4) Write Detail Line.
5) LK++, compute page totals
6) Read RawData
At End set EOF = “Yes”.
1) Write totals last page.
2) PK++
3) Write summary heading.
4) Add last page totals to report totals.
4) Write summary.
5) Write page number.
6) Close files.
New Page
Calculate Gross
Calculate FICA
Finish Last Page.
1) Write page summaries.
2) Write page number.
3) Add page totals to report
totals
Start Next Page.
4) PK++
5) Write page headings.
6) LK = 0.
Set page totals to zero.
Calculate gross pay. Pay regular time for <= 40 hours, time and a half for hours over 40, and double time for time during company recognized holidays.
Calculate FICA using current government regulations.
Legend:
PK: Page counter.
LK: Line counter (lines printed on page).
MaxLines: Desired detail lines per page.
EOF: Flag used to indicate end of file.
“D” Option (best grade is 65):
Convert the Microsoft version of the application in the class notes to GNU/Linux standard “C” with page breaks and department control breaks. You must use fscanf and fprintf. All I/O for employee records must be to files. Compile the application using gcc. You must submit a copy of all source files, data files, and the results (report).
“C” Option (best grade is a 79):
You need not complete the “D” option. Solve the problem using gcc but the modules “New Page,” Calculate Gross,” and “Calculate FICA” must be implemented as subprograms. You may not use any global variables. “Calculate Gross” and “Calculate FICA” must return their values through the name of the function. All parameters to “Calculate Gross” and “Calculate FICA” should be passed by value. “New Page” must pass any results back through the parameter list (CBR). A script must be used to produce (compile and link) the executable. You must use the following directory structure.
src directory
Project Directory
Driver
Script
Executable
Data file
Report
Calculate Gross
Calculate FICA
New Page
You must submit a copy of all source files, data files, the results (report), and the script used to build the “C” option executable.
“B” Option (best grade is 89);
Implement the “C” option but build the application using the “make” utility. You must submit a copy of all source files, data files, the results (report), the script used to build the “C” option executable, and the “Makefile” to produce the “B” option executable.
“A” Option (best grade is 100);
Grades in excess of 89 will be based on proper use of naming conventions, indentation, documentation, program clarity, and other software system attributes.
Hint: , , , , - carriage control for newline, tab, backspace, carriage return, and form feed. There are more. Look them up. Hint: left justify in field of 10 printf(“%-10d”,59), to force sign printf(“%+10d”,59), %-+d would force both the sign to print and left justify, %5.2f implies print with two digits to the right of the decimal point with a maximum of 5 digits to the left, %0 and %x prints an integer in octal and hexadecimal respectively. #define TopOfPage ‘’ and #define Bell ‘’ may be used to skip to the top of a page or ring the bell respectively.
Emp. No.
Given
Surname
Department
YTD
Pay Rate
Hours
12
Brooke
Tyler
Acct
110100.00
13.24
40.0
6
Kavanaugh
Sarah
Acct
66600.00
17.87
64.5
10
Fruci
Jordan
Acct
36600.00
10.00
10.0
22
Horn
John
Acct
109999.56
41.3
36.7
24
Pike
Jeremy
Acct
1358.34
16.22
53.5
13
Silva
Julian
DP
110090.00
10.00
1.0
5
Oliver
Logan
Mgt
673478.34
187.56
40.0
3
Nienburg
Dylan
Mgt
134234.34
67.42
56.2
1
Zhang
Zhache
Sales
11345.22
23.77
67.3
4
Curtis
Harrison
Sales
234.56
17.56
38.9
15
Welch
Wade
Sales
2342.34
27.86
45.6
17
Moreno
Issac
Sales
67000.00
34.23
40.0
Explanation / Answer
main.c
calFica.c
calGross.c
calNet.c
closingPage.c
newPage.c
dataFile.txt
sample output
please enter the file name of the input file:dataFile
please enter the name of the report file to be generated: Report
sample output
please enter the file name of the input file:dataFile
please enter the name of the report file to be generated: Report
ACME Sports Inc. We are the best, you use the best! --------------------------------------------------------------------------------------------------------- Emp # Name Dept. New YTD Gross FICA Net 12 Nicholas Arauza Acct 12345.78 529.00 35.87 493.13 6 Brian Barton Acct 66600.00 285.00 19.32 265.68 10 Drew Carlson Acct 66600.00 100.00 6.78 93.22 22 Jillian Cleek Acct 78342.56 1486.00 0.00 1486.00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page totals: 2400.00 61.97 2338.03 Page 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ACME Sports Inc. We are the best, you use the best! --------------------------------------------------------------------------------------------------------- Emp # Name Dept. New YTD Gross FICA Net 24 Charles Funk Acct 1358.34 437.00 29.63 407.37 13 Kevin Gibbs DP 126786.23 2111.00 0.00 2111.00 5 Bradley Houck Mgt 673478.34 7502.00 0.00 7502.00 3 Evan Leky Mgt 134234.34 1618.00 0.00 1618.00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page totals: 11668.00 29.63 11638.37 Page 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ACME Sports Inc. We are the best, you use the best! --------------------------------------------------------------------------------------------------------- Emp # Name Dept. New YTD Gross FICA Net 1 Franklin Leung Sales 11345.22 309.00 20.95 288.05 4 Yanxin Liu Sales 234.56 667.00 45.22 621.78 15 David Miller Sales 2342.34 975.00 66.11 908.89 17 Erik Morin Sales 67000.00 1369.00 0.00 1369.00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page totals: 3320.00 132.28 3187.72 Page 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ACME Sports Inc. We are the best, you use the best! --------------------------------------------------------------------------------------------------------- Emp # Name Dept. New YTD Gross FICA Net 12 Baily Nicholas Inven 12345.78 529.00 35.87 493.13 6 Ritesh Rana Inven 66600.00 925.00 27.12 897.88 10 Luis Rios Inven 66600.00 100.00 6.78 93.22 22 Joseph Sanchez Inven 78342.00 1846.00 0.00 1846.00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page totals: 3400.00 69.77 3330.23 Page 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _______________________________________________________________________ ACME Sports Inc. Report Summary Records processed: 16 Total Gross: 20788.00 Total FICA: 293.64 Total Net: 20494.36 Page 5 _______________________________________________________________________
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.