Question: Subject: Payroll program maintenance. Clearly state the grading option you have completed on a cover sheet with your name and the date the project is
Subject: 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. Jacksons 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: , \t, \b, , \f - 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 \014 and #define Bell \07 may be used to skip to the top of a page or ring the bell respectively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
