# Computing A Paycheck Project Help Using Python

We are the ideal platform to contact when you are struggling with your Python project. Our computing a paycheck project help service is available to all students across the globe. If you are faced with a similar project and need professional help, do not hesitate to take our computing a paycheck homework help service. Our adept team of Python homework tutors are available round the clock to ensure that you submit code solutions that are worthy of a decent grade. It doesn’t matter how inept you are at coding. With the backing of our computing a paycheck homework help service, you are guaranteed a straight A in your homework.

## Computing a Paycheck Using Python

In this project, you will compute a bi-weekly paycheck for an employee, given their salary, and marital status.
Objectives
Using what you have learned so far in this class, you will demonstrate an understanding of
• input/output
• variables
• arithmetic expressions
• branching statements (if-else)
• equality and comparison operators
• code blocks and indentation

## A User's Bi-weekly Paycheck

You will compute a user's bi-weekly paycheck (every two weeks). Gross pay is the employee's stated salary; however, we know that there are many deductions from gross pay to get net pay - the actual amount paid in the paycheck. For purposes of this project, we will only be concerned with two deductions, one for health insurance and the other for federal taxes.
The health insurance deduction is a flat rate of \$800 per year if the employee is single and \$1000 if the employee is married.
The federal tax deduction is based on the employee's marital status and their annual salary according to the following table. Note that this table is expressed in annual (yearly) terms and any calculation resulting from this table must be prorated to the bi-weekly pay frequency we are asking you to calculate.
The tax for an employee whose marital status is single will be based on the following table:

 Annual Income Tax Due (Single) 0.00 to 10000.00 5% of annual income 10000.01 to 50000.00 \$500 plus 10.5% of income over 10000 Over 50000.00 \$4700 plus 20.25% of income over 50000

Tax for an employee whose marital status is married will be based on the following table:
 Annual Income Tax Due (Married) 0.00 to 25000.00 6.25% of annual income 25000.01 to 90000.00 \$1562.50 plus 10.75% of income over 25000 Over 90000.00 \$8550.00 plus 22.5% of income over 90000

Remember that your calculation from these tables will give you an annual tax amount and you need to adjust it to represent the bi-weekly tax deduction.

You will ask the user for their salary, and whether they are married or single.

You should use input prompts to tell the user what they should enter.

The salary should be input as gross yearly salary, with no dollar signs or commas. When you read in the salary, you should account for the fact that the salary may be input as dollars and cents, eg, 42000.50.

The marital status will be entered as a single letter, 'M' or 'S' which represents married vs. single status.

You will compute the gross pay for a single paycheck, which covers two weeks. You will also need to compute the deductions (health insurance and taxes) for the paycheck and the net pay. You will then print these amounts as shown in the following example. Note: You should compute everything with as much precision as possible to save the amounts of fractional cents, but in order to print in just dollars and cents, you will need to round to the nearest penny (2 decimal places). An example of using the round function to 2 decimal places is as follows (assuming the computed net pay is in the variable net_pay):

rounded_net_pay = round(net_pay,2)

Once again, do your computations without rounding, but round only when it is time to print out the amounts. You should print a message indicating the gross pay, the deductions, and the paycheck amount, as in the following example:

For inputs of 42000.55 and M, you would print out

For this pay period:

The gross pay is \$1615.41

Total deductions are \$168.85

The paycheck is \$1446.56

Remember that white space is important!

IMPORTANT NOTE: You should start this project right away, even though we have not covered conditionals in chapter 4 yet. You should write the program assuming that everyone has a salary over \$25,000 but less than \$90,000, and is married. Get that working completely. If you do, you will pass test cases 1 and 3, and you can be confident that your expressions and logic is correct for a single case in the table. Then, once you have read chapter 4, you can change your program and add in the code you will need to cover the other cases.

## Python Code Solution

gross_annual_salary = float(input("Enter your annual salary: "))

marital_status = input("Enter 'M' if you are married or 'S' if you are single: ")

# Identify the health insurance and tax

health_insurance = 0

tax = 0

if marital_status == 'S' or marital_status == 's':

health_insurance = 800

if gross_annual_salary > 50000:

tax = 4700 + (gross_annual_salary - 50000) * 0.2025

elif gross_annual_salary > 10000:

tax = 500 + (gross_annual_salary - 10000) * 0.105

else:

tax = gross_annual_salary * 0.05

elif marital_status == 'M' or marital_status == 'm':

health_insurance = 1000

if gross_annual_salary > 90000:

tax = 8550 + (gross_annual_salary - 90000) * 0.225

elif gross_annual_salary > 25000:

tax = 1562.50 + (gross_annual_salary - 25000) * 0.1075

else:

tax = gross_annual_salary * 0.0625

# Calculate net pay and weekly salary

# Note: There are 52 weeks in a year

gross_bi_weekly_salary = (gross_annual_salary / 52) * 2

health_insurance_bi_weekly = (health_insurance / 52) * 2

tax_bi_weekly = (tax / 52) * 2

net_bi_weekly_salary = gross_bi_weekly_salary - health_insurance_bi_weekly - tax_bi_weekly

# Print out results

print()

print("For this pay period: ")

print(" The gross pay is \$" + str(round(gross_bi_weekly_salary, 2)))

print(" Total deductions are \$" + str(round(health_insurance_bi_weekly + tax_bi_weekly, 2)))

print(" The paycheck is \$" + str(round(net_bi_weekly_salary, 2)))

Related Blogs