Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the following program: Calculate the net pay of an employee by deducting federal, state, and social security taxes. Create a file named paydeductions.py which

Create the following program: Calculate the net pay of an employee by deducting federal, state, and social security taxes.

Create a file named paydeductions.py which will store the following functions and its parameters:

o Global Constants: FED_TAX = 0.1725, STATE_TAX = 0.0585, OASDI_TAX = 0.062, MEDICARE_TAX = 0.0145

o fFedTax, parameter gross pay, return federal tax (product of gross pay and appropriate constant)

o fStateTax, parameter gross pay, return state tax (product of gross pay and appropriate constant)

o fSSTax, parameter gross pay, return social security tax (product of gross pay and sum of OASDI_TAX and MEDICARE_TAX) Create the main program file (icp7-3.py), import the paydeductions file and create the following functions:

o Function main with no parameters: Display a message Welcome to the net paycheck calculator Get user input of gross pay and store it into a variable named meaningfully Call the function fDeductNetpay (see below) and store the return result into variables deductions and netPay

Display the gross pay, deductions and net pay (see output below)

o Function fDeductNetpay with parameter gross pay: Calculate the total deductions by calling the 3 functions in paydeductions and adding them up, storing it in variable deductions Calculate the net pay by subtracting the deductions from gross pay, storing it in variable netPay Return both variables

image text in transcribed
Create the following program: Calculate the net pay of an employee by deducting federal, state, and social security taxes Create a file named paydeductions.py which will store the following functions and its parameters: a Global Constants: FED_TAX =0.1725, STATE_TAX =0.0585, OASDI_TAX =0.062, MEDICARE.TAX =0.0145 fFedTax, parameter gross pay, return federal tax (product of gross pay and appropriate constant) fStateTax, parameter gross pay, retum state tax (product of gross pay and appropriate constant) ISSTax, parameter gross pay, return social security tax (product of gross pay and sum of OASDI_TAX and MEDICARE_TAX) Create the main program file (icp7-3.py), import the paydeductions file and create the following functions: Function main with no parameters: - Display a message "Welcome to the net paycheck caiculator" - Get user input of gross pay and store it into a variable named meaningfully - Call the function fDeductNetpay (see below) and store the retum result into variables deductions and netPay - Display the gross pay, deductions and net pay (see output below) Function fDeductNetpay with parameter gross pay: - Calculate the total deductions by calling the 3 functions in paydeductions and adding them up. storing it in variable deductions - Calculate the net pay by subtracting the deductions from gross pay, storing it in variable netPay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions