Question

Program Gross Pay. Implement this program using functions. Please pay attention to the requirements Function should...

Program Gross Pay. Implement this program using functions.

Please pay attention to the requirements Function should have 1 parameter for gross salary. Return is net salary. Print out employee name and net salary.

Write a program to fetch employee name and the salary. Calculate the Federal tax and state tax based on the following criteria: If the salary is greater than 100000 then calculate the federal tax at 15% otherwise calculate the federal tax at 10% Calculate the state tax at 5% Calculate the net salary of the employee. To calculate the net salary, subtract federal and state tax from the gross salary.

(PYTHON 3 CODING USING FUNCTIONS)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def net_salary(salary):
    if salary > 100000:
        federal_tax = 0.15 * salary
    else:
        federal_tax = 0.10 * salary

    state_tax = 0.05 * salary

    return salary - (federal_tax + state_tax)


def main():
    name = input('Enter your name: ')
    salary = float(input('Enter salary: '))
    net = net_salary(salary)
    print('Employee\'s name is %s and Net salary is $%.2f' % (name, net))

main()

Enter your name: Enter salary: Employees name is ronaldo and Net salary is $96000.00 Process finished with e xit code 0

Add a comment
Know the answer?
Add Answer to:
Program Gross Pay. Implement this program using functions. Please pay attention to the requirements Function should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please do this in Python 3 DESCRIPTION Using For.. loop, Write a program to fetch the...

    Please do this in Python 3 DESCRIPTION Using For.. loop, Write a program to fetch the name, salary and the state of 5 employees. Calculate the federal tax, state tax and the net salary for each employee. Use the following criteria: To calculate the federal tax, use the following criteria: If the salary is greater than 100.000 then calculate the federal tax at 20 percent Otherwise calculate the federal tax at 15%. To calculate the state Tax, use the following...

  • You are to write a program that will process employees and their pay. For each employee...

    You are to write a program that will process employees and their pay. For each employee the program will read in an employee’s name and hourly pay rate. It should also read in the number of hours worked each day for 5 days and calculate his or her total number of hours worked. You must read the hours using a loop. The program should output the employee’s name, gross pay, total withholding amount and net pay. Withholding is made up...

  • You should implement several functions that the Phone Contacts program will need Each function with take...

    You should implement several functions that the Phone Contacts program will need Each function with take in data through the parameters (i.e., variables names listed in parentheses) and make updates to data structure that holds the contact information, return, or print information for a particular contact. The parameters needed are listed in the table below and each function is described below that 1. Make an empty dictionary and call it 'contacts'. Where in your code would you implement this? Think...

  • Tax Calculator: Write a program that calculates Federal and CA State tax based on gross income...

    Tax Calculator: Write a program that calculates Federal and CA State tax based on gross income that was input from user. The program should print the gross income, federal tax mount, state tax amount and net income (earnings after tax deduction) using python program

  • Please include function in this program Write a C program that will calculate the gross pay...

    Please include function in this program Write a C program that will calculate the gross pay of a set of employees utilizing pointers instead of array references. You program should continue to use all the features from past homeworks (functions, structures, constants, strings). The program should prompt the user to enter the number of hours each employee worked. When prompted, key in the hours shown below. The program determines the overtime hours (anything over 40 hours), the gross pay and...

  • ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for...

    ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...

  • Write a C program that will calculate the gross pay of a set of employees. The...

    Write a C program that will calculate the gross pay of a set of employees. The program should prompt the user to enter the number of hours each employee worked. When prompted, key in the hours shown below. The program determines the overtime hours (anything over 40 hours), the gross pay and then outputs a table in the following format. Column alignment, leading zeros in Clock#, and zero suppression in float fields is important. Use 1.5 as the overtime pay...

  • please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of...

    please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of tax withheld from an employee’s weekly salary, the tax deduction to which the employee is entitled for each dependent, and the employee’s take- home pay. The program output includes state tax withheld, federal tax withheld, dependent tax deductions, salary, and take-home pay. Instructions Ensure the source code file named Payroll.cpp is open in the code editor. Variables have been...

  • C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their...

    C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their manual payroll system to a computer-based system. Write a program to produce a 1-week payroll report for only one employee to serve as a prototype (model) for the administration to review. Input for the system will be the employee’s 4-digit ID number, the employee’s name, hours worked that week, and the employee’s hourly pay rate. Output should consist of the employee’s ID number, the...

  • in c++ Define and implement the class Employee with the following requirements: private data members string...

    in c++ Define and implement the class Employee with the following requirements: private data members string type name a. b. double type hourlyRate 2. public member functions a. default constructor that sets the data member name to blank"and hourlyRate to zero b. A constructor with parameters to initialize the private data members c. Set and get methods for all private data members d. A constant method weeklyPay() that receives a parameter representing the number of hours the employee worked per...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT