In: Computer Science
Activity Statement- The Payroll department at xyz company would like you to develop a computer program that will determine the net pay of an employee. Design a Python program, which utilizes modules, that asks the user to enter the Name of employee, the total number of hours worked by the employee, and the hourly pay rate of the employee. The program will determine the Employee Gross Pay, the Paid Federal Taxes ( 30% of the Employee Gross Pay ), the Paid State Taxes ( 10% of the Employee Gross Pay ), and the Employee Net Pay ( Gross Pay - Federal Taxes - State Taxes ). In addition, the program will display the following items:
Activity Instructions-
Here Iam providing the code and the output for the given problem.
Code:-
Code in text format:-
def main(): #main fucntion
getEmpInfo()
computeGrossPay()
computePaidFedTax()
computePaidStateTax()
computeNetPay()
printEmpInfo()
def getEmpInfo():
global name, TotalWorkingHours, HourlyRate #varibles
name = input("Enter employee name : ") #taking input from
user
TotalWorkingHours = int(input("Enter total working hours :
"))
HourlyRate = int(input("Enter HourlyRate : "))
def computeGrossPay():
global EmployeeGrossPay
EmployeeGrossPay = HourlyRate * TotalWorkingHours #calculation of
EmployeeGrossPay
def computePaidFedTax():
global EmployeePaidFederalTaxes
EmployeePaidFederalTaxes = EmployeeGrossPay * 0.3
def computePaidStateTax():
global EmployeePaidStateTaxes
EmployeePaidStateTaxes = EmployeeGrossPay * 0.1
def computeNetPay():
global EmployeeNetPay
EmployeeNetPay = EmployeeGrossPay - (EmployeePaidFederalTaxes +
EmployeePaidStateTaxes)
def printEmpInfo():
print("\n") #printing the employee info
print(name + " Is the name of the employee")
print(str(TotalWorkingHours)+ " is the TotalWorkingHours")
print(str(HourlyRate) + " is the HourlyRate")
print(str(EmployeePaidFederalTaxes) + " is the Employee Paid
Federal Taxes")
print(str(EmployeePaidStateTaxes) + " is Employee Paid State
Taxess")
print(str(EmployeeNetPay) + " is the Employee Net Pay")
main()
output:-