Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Payroll program c++ source code

06/12/2021 Client: muhammad11 Deadline: 2 Day

CSE100 Principles of Programming with C++ Lab 6 :: 5 pts

1 Instructions You may work in pairs (that is, as a group of two) with a partner on this lab project if you wish or you may work alone. If you work with a partner, only submit one lab project with both of your names in the source code file to Blackboard for grading; you will each earn the same number of points. What to hand in, and by when, is discussed in Section 5; read it.

2 Lab Objectives After completing this assignment the student should be able to:

● Complete all of the objectives of the previous lab projects. ● Write function definitions, call functions, pass parameters, define local variables, and return values from functions. ● Write if, if-else, and if-elseif-... statements. ● Open a text file for reading/writing and read/write strings and numbers from/to the text file. ● Use the fixed and setprecision stream manipulators to control the number of digits printed after the decimal point for doubles. ● Document formal test cases and perform testing to verify program correctness.

3 Prelab Exercises ● First, skip to Section 4 and read the lab project problem description and software requirements. Then come back here. ● Navigate to the course website and download the Lab06.cpp file. This file is a template containing most of the code for the lab

project, but in various places, the code has not been completed. Your job shall be to complete the code by reading the comments and writing proper C++ code in the locations indicated by ??? symbols. Follow the instruction in Steps 31-35 of the Code::Blocks tutorial1 to add Lab06.cpp to your Code::Blocks project.

● Navigate to the course website and download the payroll.txt file. This program will read input data from this file and will write data to an output file named paycheck.txt. Copy payroll.txt to your Code::Blocks Lab06 project folder. For example, when you created your Lab06 project, if you specified C:\cse100\Lab06 as the project folder, then copy payroll.txt to C:\cse100\Lab06 (note: on Macs, it has to be placed in a different folder; consult your TA).

When you run your program, you will see the output window appear, but nothing will be displayed in it. This is because the output is being sent to the output file named paycheck.txt rather than to the output window. To know if your program worked correctly, you need to open the output file and examine its contents. Click File | Open on the main menu. In the Open dialog, navigate to your project directory where you should see a file named paycheck or possibly paycheck.txt. Click on that file name and then click the Open button. Verify the output file contains the correct contents. If the output file contains gibberish or a lot of seemingly weird numbers then the input file is not being correctly opened for reading.

● Writing Test Cases (1 pt) The Lab06.cpp source code file contains one test case documented in the header comment block, which you may use to test the correctness of your program. You are two write two additional test cases, documenting them in the header comment block of Lab06.cpp, formatted as shown below. When you have completed writing the test cases, copy the comments documenting the test cases from Lab06.cpp to a word processing document and convert this document into PDF format. The format for documenting the test cases is: // ------------------------------------------------------------------------------------------------- // TEST CASE 1: // ------------------------------------------------------------------------------------------------- // Test Input Data: // employee-last-name employee-first-name // employee-hourly-pay-rate employee-hours-worked // employee-med-insurance-status-code // // Expected Results: // ------------------------------------------------- // EMPLOYEE: employee-last-name, employee-first-name // // PAY RATE: $ ????? // HOURS: ????? // GROSS PAY: $ ????? // MED INS DEDUCT: $ ????? // 401K DEDUCT: $ ????? // FED TAX GROSS PAY: $ ????? // TAX - FEDERAL: $ ????? // TAX - OASDI: $ ????? // TAX - MEDICARE: $ ????? // TAX - STATE: $ ?????

1 http://devlang.com/cse100_codeblocks

(c) Burger :: Computer Science & Engineering :: Arizona State University Page 1

http://devlang.com/cse100_codeblocks
CSE100 Principles of Programming with C++ Lab 6 :: 5 pts

// TAX - TOTAL: $ ????? // NET PAY: $ ????? // ----------------------------- // // ------------------------------------------------------------------------------------------------- // TEST CASE 2: // ------------------------------------------------------------------------------------------------- // Test Input Data: // employee-last-name employee-first-name // employee-hourly-pay-rate employee-hours-worked // employee-med-insurance-status-code // // Expected Results: // ------------------------------------------------- // EMPLOYEE: employee-last-name, employee-first-name // // PAY RATE: $ ????? // HOURS: ????? // GROSS PAY: $ ????? // MED INS DEDUCT: $ ????? // 401K DEDUCT: $ ????? // FED TAX GROSS PAY: $ ????? // TAX - FEDERAL: $ ????? // TAX - OASDI: $ ????? // TAX - MEDICARE: $ ????? // TAX - STATE: $ ????? // TAX - TOTAL: $ ????? // NET PAY: $ ????? // -----------------------------

Where ????? are the numbers you expect to see in paycheck.txt when you run your program using the documented test input data. I would suggest using Excel or some other spreadsheet program to perform the calculations for you. I would suggest that your three test cases (the one I gave you and the two you are creating) test all three possible values for the medical insurance status code. For example, for the test case I gave you, I used 2. I would suggest using 0 for your first test case and 1 for your second test case. Remember, the entire point of testing is to try to find bugs. Although asking you to create these test cases before you write the code may seem like busy work, my objective is to get you to understand that just because your program compiles and runs does not mean it is correct, i.e., bug-free. A reasonably large program can never be proven to be bug-free. The best we can do is to test, test, and test some more to try to find all the bugs we can. IMPORTANT NOTE WRITTEN IN RED TEXT: Upload the completed test case PDF document (not Lab06.cpp) to BB using the Lab 6 Prelab submission link (do not use the Lab 6 submission link) by the submission deadline, which is 4:00am Mon 5 Oct. Note, this is a hard deadline, i.e., late submissions are not accepted for grading.

4 Lab Exercise All employees at FreeMedicalOrgans.com2 are paid biweekly, i.e., every two weeks. An hourly employee's biweekly gross pay (denoted by variable grossPay) is calculated as the number of hours he or she worked (denoted by variable hrsWorked) during the pay period multiplied by his or her hourly pay rate (denoted by variable payRate). In addition, hourly workers are eligible for overtime pay if their hours worked exceeds 80 hours during the two week pay period. The overtime pay rate is one-and-a-half times the usual pay rate. For example, if Wilma worked 87 hrs and her pay rate is $19.25 per hour, then her gross pay would be calculated as grossPay = (80 * $19.25) + (7 * $19.25 * 1.5) = $1742.13.

All employees have taxes withheld from their paychecks. Taxes that are withheld by the employer are: (1) federal income tax (denoted by variable taxFed); (2) state income tax (denoted by variable taxState); (3) federal social security tax (denoted by variable taxOASDI3); and (4) federal medicare tax (denoted by variable taxMedicare).

The amounts withheld for this group of four taxes are based on a percentage of the employee's federal taxable gross pay (denoted by variable fedTaxGrossPay). An employee's federal taxable gross pay is equal to his or her gross pay minus deductions made for the mandatory company 401K retirement plan (denoted by variable four01kDeduct) and medical insurance (denoted by variable medInsDeduct). All employees are required to contribute 6.0% (denoted by constant FOUR01K_RATE = 0.06) of their gross pay to the

2 Where our motto is, "Trust us, you don't want to know where these things come from, but, well, umm, oink." 3 OASDI stands for Old Age, Survivors, and Disability Insurance.

(c) Burger :: Computer Science & Engineering :: Arizona State University Page 2

CSE100 Principles of Programming with C++ Lab 6 :: 5 pts

company 401K retirement plan. The rate an employee pays for medical insurance is based on this table (where variable medInsStatus contains the medical insurance status code of 0, 1, or 2),

Medical Insurance Status Biweekly Cost to Employee Employee only, no dependents (code = 0) $32.16 Employee + 1 dependent (code = 1) $64.97 Family (code = 2) $110.13

The federal income tax withheld (variable taxFed) from the employee's paycheck is based his or her federal taxable gross pay and this table,

Federal Taxable Gross Pay Federal Tax Withholding Percentage < $384.62 0.00% ≥ $384.62 and < $1413.67 7.97% ≥ $1413.67 and < $2695.43 12.75% ≥ $2695.43 19.5%

The amount withheld for state income tax (variable taxState) is based on a percentage of federal taxable gross pay per the following table,

Federal Taxable Gross Pay State Tax Withholding Percentage < $961.54 1.19% ≥ $961.54 and < $2145.66 3.44% ≥ $2145.66 7.74%

The amount withheld for OASDI (variable taxOasdi) is 6.2% (denoted by constant OASDI_RATE = 0.062) of federal taxable gross pay and the federal medicare tax is 1.45% (denoted by constant MEDICARE_RATE = 0.0145) of the employee's federal taxable gross pay.

For this programming exercise, you are to complete the C++ program template you downloaded from the course website. In the code are comments describing the code and indicating what statements you must write to complete the program. The places where you must write code are indicated by ??? symbols.

The program opens a text file named payroll.txt which contains payroll information for one hourly employee of FreeMedical Organs.com. The format of the data in the file is,

lastName firstName payRate hrsWorked medInsStatus

The medInsStatus field is either 0 (for employee only, no dependents), 1 (for employee + one dependent), or 2 (for family); see the Medical Insurance Status Table above. An example hourly employee record would be,

Simpson Homer 15.25 84.0 2

Here, the employee's first and last names are "Homer" and "Simpson". Homer's pay rate is $15.25 per hour and he worked 84 hours in the last biweekly pay period (4 hours of overtime). Homer's medical insurance status is 2 (for employee + family). The program shall read the information from the file and perform calculations to determine,

1. Biweekly gross pay (stored in a variable named grossPay) 2. Company-required 401K deduction (four01kDeduct) 3. Medical insurance deduction (medInsDeduct) 4. Federal taxable gross pay (fedTaxGrossPay) 5. Federal income tax (taxFed) 6. OASDI tax (taxOASDI) 7. Medicare tax (taxMedicare) 8. State income tax (taxState) 9. Total taxes (taxTotal) 10. Net pay (netPay)

The fedTaxGrossPay is the employees gross pay reduced by his or her medical insurance deduction and mandatory 401K contribution (fedTaxGrossPay = grossPay - medInsDeduct - four01kDeduct). The total taxes (taxTotal) is the sum of taxFed, taxOASDI, taxMedicare,

(c) Burger :: Computer Science & Engineering :: Arizona State University Page 3

CSE100 Principles of Programming with C++ Lab 6 :: 5 pts

and taxState. The employee's net pay (netPay) is his or her federal taxable gross pay minus total taxes (netPay = fedTaxGrossPay – tax_total).

The program shall then open an output file named paycheck.txt for writing and shall output the paycheck in this format,

----------------------------- EMPLOYEE: Simpson, Homer

PAY RATE: $ 15.25 HOURS: 84.00 GROSS PAY: $ 1311.50 MED INS DEDUCT: $ 110.13 401K DEDUCT: $ 78.69 FED TAX GROSS PAY: $ 1122.68 TAX - FEDERAL: $ 89.48 TAX - OASDI: $ 69.61 TAX - MEDICARE: $ 16.28 TAX - STATE: $ 38.62 TAX - TOTAL: $ 213.98 NET PAY: $ 908.70 -----------------------------

Note that all real numbers are printed with two digits after the decimal point. This is controlled by using the fixed and setprecision stream manipulators. The numbers are all output right-justified in a field of width 8. This is controlled by using the right and setw() manipulators. Once the paycheck file has been printed, the output file shall be closed and the program shall terminate.

4.1 Additional Programming Requirements 1. Update the header comment block in the source code template with your author information, your lab date and time, your lab

TA, and the two test cases you are to write for the prelab exercise. 2. Carefully format your code and follow the indentation of the text as shown in the example programs of the textbook. 3. Use the double data type for any variables which will contain real numbers. Use int if the variable will only store integer numbers.

Note that arithmetic on integer values is more efficient (i.e., it takes less time) than arithmetic on real values, so when possible, variables should always be defined as integers unless the numbers that will be stored in that variable are real numbers.

4. When you complete the program, you will run it three times using the three test cases as the input. Document in your testing results (in the header comment block of your source code file) the Actual Output from the program (i.e., the contents of pay check.txt). If the Expected Output matches the Actual Output for all three test cases, then your program is probably implemented correctly. However, if there is a mismatch then it could be caused by one of two things: (1) the calculations you did in determining the expected output were incorrect and your test case contains incorrect data; or (2) your program has a bug in it and it is not outputting the correct results. In the case of (1) you should recalculate the expected output and then rerun the test. In the case of (2) you should locate the bug(s) and correct them. Keep re-running the program on the test cases until all test cases pass. When your testing is compete, document your test cases and testing results at the top of your source code file, in the comment header block. Indicate if each of the test cases passed or failed.

5 What to Submit for Grading and by When Upload the test cases you created for the prelab exercise in a PDF file to BB by 4:00am Mon 5 Oct (use the Blackboard Lab 6 Prelab submission link; do not use the Lab 6 submission link). Upload the Lab06.cpp C++ source code file to Blackboard using the Lab 6 submission link by the deadline, which is 4:00am Sat 17 Oct. If your program does not compile or run correctly, upload what you have completed for grading anyway (you will generally receive some partial credit for effort). Consult the online syllabus for the late and academic integrity policies.

6 Grading Rubric 1. Prelab Exercise Test Case (1 pt) The student was to have uploaded a PDF containing their two test cases to BB. The PDF will be found in the Lab 6 Prelab column of Grade Center. They were to also have documented the same test cases in the header comment block of their .cpp source code file. The header comment block in the source code file should also document the actual output and whether the test case PASSED or FAILED.

a. For two reasonably well-written and sufficiently documented test cases in the PDF and in the .cpp file, assign +1 pt. b. If the student made an attempt to write the test cases, but they are somewhat poorly written or not sufficiently detailed, assign +.5 pts. c. If the student submitted less than two test cases, assign +.25 pts if the one submitted test case(s) is sufficiently documented. d. Assign +0 pts for no test cases (no PDF uploaded) and/or for not documenting the actual output and the test cases results in the .cpp file.

(c) Burger :: Computer Science & Engineering :: Arizona State University Page 4

CSE100 Principles of Programming with C++ Lab 6 :: 5 pts

2. Lab Exercise Program (0 to 4 pts) I have document three test cases in the solution code in Section 7. Use these test cases to test the students' code.

a. If the submitted program does, or does not, compile and the student completed less than 50% of the required code correctly, assign +1 pt c. If the submitted program does not compile and the student completed more than 50% of the required code correctly, assign +2 pts. d. If the submitted program compiles and the student completed more than 50% of the required code correctly, assign +3 pts. e. If the submitted program compiles and is implemented perfectly, or close to perfect with only one or two minor mistakes, assign +4 pts.

3. Deadline was 4:00am Sat 17 Oct 1. Assign 20% bonus calculated on the earned pts for a submission prior to 4:00am Thu 15 Oct. 2. Assign 10% bonus calculated on the earned pts for a submission between 4:00am Thu 15 Oct and 4:00am Fri 16 Oct. 3. Deduct 0.5 pt for a submission between 4:00am Sat 17 Oct and 4:00am Sun 18 Oct. 4. Deduct 1 pt for a submission after 4:00am Sun 18 Oct.

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Financial Hub
Engineering Guru
Instant Assignments
Assignment Guru
Helping Engineer
Quality Assignments
Writer Writer Name Offer Chat
Financial Hub

ONLINE

Financial Hub

I have done dissertations, thesis, reports related to these topics, and I cover all the CHAPTERS accordingly and provide proper updates on the project.

$17 Chat With Writer
Engineering Guru

ONLINE

Engineering Guru

I will be delighted to work on your project. As an experienced writer, I can provide you top quality, well researched, concise and error-free work within your provided deadline at very reasonable prices.

$21 Chat With Writer
Instant Assignments

ONLINE

Instant Assignments

I have read your project details and I can provide you QUALITY WORK within your given timeline and budget.

$32 Chat With Writer
Assignment Guru

ONLINE

Assignment Guru

I am a professional and experienced writer and I have written research reports, proposals, essays, thesis and dissertations on a variety of topics.

$45 Chat With Writer
Helping Engineer

ONLINE

Helping Engineer

I will be delighted to work on your project. As an experienced writer, I can provide you top quality, well researched, concise and error-free work within your provided deadline at very reasonable prices.

$30 Chat With Writer
Quality Assignments

ONLINE

Quality Assignments

I have done dissertations, thesis, reports related to these topics, and I cover all the CHAPTERS accordingly and provide proper updates on the project.

$45 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Large african stork crossword clue - Top accounting firms melbourne - 324 ne 12th st grand prairie tx - Characteristics of beowulf with quotes - Pnf upper body stretches - No gumption summary - Crankshaft position sensor diagram - Iso 8573 1 pdf - Ifsm 201 excel project 1 - Advanced inventory management cvs answers - Abn amro bank chicago - Computech corporation is expanding rapidly - 38 cromwell road south yarra - Unisa digital learning strategy - Rationale for government intervention in international trade - Case 6 national collegiate athletic association ethics and compliance program - 63 divided by 3 - Unit III Assignment Org Ther BH - Human resource questions - Qxd = 14 - (1/2)px and qxs = (1/4)px - 1 - W8 - Mindtap french answers - Shake design tadiran group - Wendy Lewis 1 - 7-1 Discussion: Issey Miyake - Short report - Policy-Maker Letter - Two Discussion Responses Needed 100 Words Each 200 Words Total - Unit IV Case Study(For Dr.Ellen RM) - Where a streambed curves deposition occurs - Example of 6x6 rule powerpoint - Quiz 5 - Nrs 490 professional capstone and practicum - How does course hero unlocks work - There are more tertiary consumers than there are - Lifelong vitality pack pdf - 2016 sea doo spark 3up specs - Stat - Human Captial - Common drain amplifier voltage gain - We can see list of memorandum vouchers from - Ammonium chloride aq ammonia g hydrochloric acid aq - What is the personal value equation - Individual professional development plan - Functional assessment informant record for teachers - Deal or no deal math probability - Richard hillis heart attack - Human effects on the biosphere - Why are proposals important to many businesses - Concurrent disorders certificate program - Roland vs 2480 dvd - 42 ryton street kings meadows - 1 prop z test - Goldsbrough mort & co ltd v quinn - Big gems public health examples - Case Analysis - Does music affect your concentration - Air force virtual education center - Certified construction manager ccm online training - Cells alive mitosis cell parts worksheet answers - Meraki sd-wan design guide - Cewe prometer user manual - Arrange the following atoms in order of decreasing electronegativity - Bee movie worksheet answers take charge today - 3 circle analysis marketing - Discussion: 5 Reasons Our Client's Sexuality is Important to Address in Counseling . - Schedules of reinforcement worksheet with answers - SPC - During an ice show a 60 kg skater - Ethical and legal implications of prescribing drugs for nurse practitioners - Girls and Gangs - Walmart in japan case study solution - Similarities between prokaryotic and eukaryotic cells - How to open jayco awning - Divinely inspired moral law judaism - Full project report on image steganography pdf - Home work Assignment - Discussion Week 8 - Riga st petersburg vilciens - Week532- 2 - Legal and Ethical implications in Healthcare - SOCW 6103 Week 3 Discussion post responses - Discussion: Team Approach to Addiction Treatment - Order # 9692 - Magento demo store exploit - Philosophy101 - African caribbean care group - How many languages does trevor noah speak - Specific governance plan that exists at a company - Facing the screen dilemma young children technology and early education - 2 pages - MINI CASE ANALYSIS 1000 WORDS - Eaton generator quick connect - Ops 571 week 6 signature assignment - Sabsa framework and methodology - Defeating the system ethics at volkswagen - The cfo of the company believes that an appropriate annual interest rate - Palmerston district primary school - Jules sebastian slow cooked lamb - Discussion -3 - Love in the time of cholera wedding reading