Question

In: Computer Science

in python language The Payroll Department keeps a list of employee information for each pay period...

  1. in python language

  2. The Payroll Department keeps a list of employee information for each pay period . The format of each line of the file is the following:

  3. <lastname> < hours worked> < Income>

    Write a program that inputs from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header. Each line should contain an employee’s name, the hours worked, and the wages paid for that period.

    Output example:

    Lastname

    Hours worked

    Income

    Lambert

    120

    $1000

q2

Write a program to read and calculate the tax due for each income.

The amount of tax is calculated using the following table. For example, if an income is $1500, the formula to compute the tax is: 7.5 + (1500-750)*0.02 , that results in the tax amount to be $22.5.

Income

Amount of tax

Not over $750

1% of income

$750 to $2,250

$7.5 plus 2% of amount over $750

$2,250 to $3,750

$37.50 plus 3% of amount over $2,250

$3,750 to $5,250

$82.50 plus 4% of amount over $3,750

$5,250 to $7,000

$142.50 plus 5% of amount over $5,250

Over $7000

$230.00 plus 6% of amount over $7,000

Output example:

Lastname

Hours worked

Income

Tax

Lambert

120

$1000

$12.5

Solutions

Expert Solution

PYTHON CODE(Q1)

firstName = []#List of first name of employee
lastName = []#List of last name of employee
hoursWorked = []#List of hours worked
income = []#List of income of employee
ch = ''
while ch!='n' and ch!='N':#Get details of employees
    firstName.append(input("Enter Employee's first name:"))
    lastName.append(input("Enter Employee's last name:"))
    hoursWorked.append(int(input("Enter hours worked:")))
    income.append(int(input("Enter income amount:")))
    ch = input("Want to continue?(y/n):")
print("LastnameHours workedIncome")
for ind in range(len(firstName)):#Display employees details
    print("%s%s$%s"%(lastName[ind].ljust(8,' '), str(hoursWorked[ind]).ljust(12,' '), str(income[ind]).ljust(5,' ')))

PYTHON CODE SCREENSHOT

OUTPUT SCREENSHOT

PYTHON CODE(Q2)

def calculateTax(income):#function calculate the tax for given income
    if income <= 750:
        return 750*0.01
    elif income > 750 and income <= 2250:
        return 7.5 + ((income - 750) * 0.02)
    elif income > 2250 and income <= 3750:
        return 37.50 + ((income - 2250) * 0.03)
    elif income > 3750 and income <= 5250:
        return 82.50 + ((income - 3750) * 0.04)
    elif income > 5250 and income <= 7000:
        return 142.50 + ((income - 5250) * 0.05)
    elif income > 7000:
        return 230.00 + ((income - 7000) * 0.06)

firstName = []#List of first name of employee
lastName = []#List of last name of employee
hoursWorked = []#List of hours worked
income = []#List of income of employee

ch = ''
while ch!='n' and ch!='N':#Get details of employees
    firstName.append(input("Enter Employee's first name:"))
    lastName.append(input("Enter Employee's last name:"))
    hoursWorked.append(int(input("Enter hours worked:")))
    income.append(int(input("Enter income amount:")))
    ch = input("Want to continue?(y/n):")
print("LastnameHours workedIncomeTax")
for ind in range(len(firstName)):#Display employees details
    tax = calculateTax(income[ind])
    print("%s%s$%s$%.1f"%(lastName[ind].ljust(8,' '), str(hoursWorked[ind]).ljust(12,' '), str(income[ind]).ljust(5,' '), tax))

PYTHON CODE SCREENSHOT

OUTPUT SCREENSHOT


Related Solutions

The Payroll Department keeps a list of employee information for each pay period in a text...
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header. Each line should contain: An employee’s name The hours worked The wages paid...
Please write in Python 3.7.4 or Higher. The Payroll Department keeps a list of employee information...
Please write in Python 3.7.4 or Higher. The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: <last name> <hours worked> <hourly wage> Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header....
Rubos Inc had the following payroll information for the pay period ending 10/31/2012. Total payroll was...
Rubos Inc had the following payroll information for the pay period ending 10/31/2012. Total payroll was $640,000. Unemployment taxes rates were 4.5% for State unemployment and .8 % for federal unemployment. . Income taxes withheld were $130,00. Union dues withheld were $36,000. Insurance premiums withheld were $24,000. Rubos also has an employee retirement plan which had contributions from employees of $14,000. Rubos matches all employee contributions with employer contributions of 50%. Prepare all necessary journal entries to record the payroll...
Internal controls 1. Any changes to employee master file information since the last payroll period are...
Internal controls 1. Any changes to employee master file information since the last payroll period are evaluated to ensure that they have been properly authorized by the appropriate personnel. 2. The output is reviewed for reasonableness prior to distribution to users. Consider the four methods of testing the operating effectiveness of controls (inquiry, observation, document examination, and re-performance). For each of the preceding controls, provide an example of how Mark's audit team might choose to test the operating effectiveness of...
Perez Company has the following information for the pay period of January 15–31. Gross payroll $20,000...
Perez Company has the following information for the pay period of January 15–31. Gross payroll $20,000     Federal income tax withheld $2,500 Social security rate 6%     Federal unemployment tax rate 0.8% Medicare rate 1.5%     State unemployment tax rate 5.4% Assuming no employees are subject to ceilings for their earnings, calculate Salaries Payable and Payroll Tax Expense. Salaries Payable $ Payroll Tax Expense $
Lee Company has the following information for the pay period of December 15–31: Gross payroll $18,387...
Lee Company has the following information for the pay period of December 15–31: Gross payroll $18,387 Federal income tax withheld $3,127 Social security rate 6% Federal unemployment tax rate 0.8% Medicare rate 1.5% State unemployment tax rate 5.4% Assuming no employees are subject to ceilings for taxes on their earnings, Salaries Payable would be recorded for a.$14,120.01 b.$18,387.00 c.$13,880.97 d.$12,740.98
Lee Company has the following information for the pay period of December 15–31: Gross payroll $15,189...
Lee Company has the following information for the pay period of December 15–31: Gross payroll $15,189 Federal income tax withheld $2,227 Social security rate 6% Federal unemployment tax rate 0.8% Medicare rate 1.5% State unemployment tax rate 5.4% Assuming no employees are subject to ceilings for taxes on their earnings, Salaries Payable would be recorded for a.$11,822.83 b.$10,881.11 c.$12,020.28 d.$15,189.00
For the payroll period ended on June 25, 2013, gross pay was $20,750, net pay was...
For the payroll period ended on June 25, 2013, gross pay was $20,750, net pay was $12,000, FICA tax withholdings were $3,500, income tax withholdings were $4,200, and medical insurance contributions were $1,050.
List department name, employee id, and employee name for all employees in department name order. Repeat...
List department name, employee id, and employee name for all employees in department name order. Repeat for department #10 only. List the course ID, course name, section, instructor name, day, time, and room for all course sections. List the course ID, course name, section, student ID, and student name for CRN 1003. Display the list in ascending order of student last and first names. DROP TABLE registration; DROP TABLE sections; DROP TABLE courses; DROP TABLE students; DROP TABLE instructors; CREATE...
The summary of the payroll for the monthly pay period ending July 15 indicated the following:...
The summary of the payroll for the monthly pay period ending July 15 indicated the following: Sales salaries $125,000 Federal income tax withheld 32,300 Office salaries 35,000 Medical insurance withheld 7,370 Social security tax withheld 10,200 Medicare tax withheld 2,550 a. Journalize the entry to record the payroll. If an amount box does not require an entry, leave it blank or enter 0. b. Journalize the entry to record the employer's payroll tax expense for the month. The state unemployment...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT