Salesure is a social media marketing startup. They have 10 employees working on a casual basis. Being a small company, Salesure do not have resources to purchase professional payroll software. They have hired you to write a simple Python program that can work out the amount of tax to withhold from their employee salaries.
Employees are payed fortnightly, and because of casual nature of the job each fortnight the payment is different. The amount of withheld tax depends on the gross payment in each fortnight, and the income tax rates for the corresponding income bracket.
Following are the income tax rates advised by Government Taxation Department. Gross annual income should be rounded down to nearest dollar before any tax calculation.
|
Annual Taxable Income |
Tax Percentage |
|
0 to 15,000 |
5% |
|
15,001 to 40,000 |
15% |
|
40,001 to 90,000 |
28% |
|
90,001 to 150,000 |
21% |
|
150,000 and over |
13% |
An example of withheld tax calculation goes like this. Sam is entitled to fortnightly payment of $1870. To calculate income tax applicable, an estimate of Sam's annual income is needed. There are 52.143 weeks in a year. An estimation of annual income will therefore be $1870 × 52.143 / 2 = $48,753.705 or $48,753 after rounding down. From the table, the applicable tax rate is 28%. Hence, the amount of tax to withhold will be 28% of $1870 = $523.60, and Sam will be payed an after-tax salary of $1346.40 in this fortnight.
Using this method, your program will ask the user for the employee name and their gross fortnightly salary, and then it will work out the tax to withhold and actual salary to be payed out. At the end of a calculation, program would ask if user wants tax calculation of another employee (in which case it loop through the whole process) or finish.
You do not have to handle invalid inputs (like non-numeric salary, empty name etc.). All the currency figures must be displayed as floating point numbers with 2 decimal places.
Below is a sample execution of the program. You should follow the same display style.
Welcome to Salesure Tax Payroll Calculator
------------------------------------------
Please enter employee name: Sam
Please enter gross fortnightly payment for [Sam]:
1870
Amount of tax to withhold: $523.60
Salary payable to [Sam]: $1346.40
Do you want to calculate pay for another employee? (y/n):
y
Please enter employee name: Carla
Please enter gross fortnightly payment for [Carla]:
1207.80
Amount of tax to withhold: $181.17
Salary payable to [Carla]: $1026.63
Do you want to calculate pay for another employee? (y/n):
n
Thank you. See you later.
Task: Implement your algorithm in Python. Comment on your code as necessary to explain it clearly

# if you find any problem or aren't able to understand any part of the code, make a follow-up #comment. I'll be glad to help
def calculateBracket(payout):
#makes a yearly salary estimate
yearly=payout*52.143/2
#retuns fraction instead of percentages
if(0<yearly<15000):
# return 5%
return 0.05
elif(15001<yearly<40000):
# return 15%
return 0.15
elif(40001<yearly<90000):
return 0.28
elif(90001<yearly<150000):
return 0.21
else:
return 0.13
#folowing method asks for name and payment and shows the respective data
def payment():
#takes the username input
name=input("Please enter emplyee name: ")
#input for fortnightly payment
grosspayout=float(input("Pless enter gross fortnightly payment for "+name+": "))
#calcultes Tax using calling the calculateBracket()
tax=calculateBracket(grosspayout)*grosspayout
#subtracts the the tax from the payout
payout=grosspayout-tax
print("Amount of tax to withold: $"+str(tax))
print("Salary payable to "+name+": $"+str(payout))
#following method is the driver method
def main():
print("Welcome to Salessure Tax Payroll Calculator")
print("------------------------------------\b")
#looops infinitley
while(True):
payment()
print(" ")
#asks if we want to continue
anotheremp=input("Do you want to calculate pay for another employee? (y/n): ")
#if the user enteres "n" breaks the loops
if(anotheremp=="n"):
print("Thank you. See you later.")
break
main()
Salesure is a social media marketing startup. They have 10 employees working on a casual basis....
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...
You are 21-years-old and working in the marketing department of a medium-sized corporation. You are earning an annual salary of $40,000 paid every two weeks. Your employer provides a 401 (k) plan, and matches employee contributions by 50% up to a maximum 3% of your annual salary. You are in a 25% marginal tax rate. 1)Assume that you contribute 6% of your gross income to your 401 (k) account. How much will you contribute annually and per pay period to...
The names of the employees of Cox Security Systems and their regular salaries are shown in the following payroll register. Note that Hall and Short are paid monthly on the last payday, while all others are paid weekly. In addition to the regular salaries, the company pays an annual bonus based on the amount of earnings for the year. For the current year, the bonus amounts to 8% of the annual salary paid to each employee. The bonus is to...
Write a Java application with a class name of Payroll, for the “Travel Agency”, that willCalculate the weekly paycheck for both Salaried and Hourly employees. Salaried employees will be paid 1/52 of their annual pay minus 18% withheld for federal and state taxes, as well as 4% for retirement pension. Salaried employees do not collect overtime pay. There are two types of Hourly employees; permanent employees and temporary weekly employees. •Permanent weekly employees will be paid their hourly rate minus...
Nashville Publishing Company pays its employees monthly. Payments made by the company on October 31, 2019, follow. Cumulative amounts paid to the persons named prior to October 31 are also given. Paul Parker, president, gross monthly salary of $20,000; gross earnings prior to October 31, $160,000. Carolyn Wells, vice president, gross monthly salary of $15,000; gross earnings paid prior to October 31, $150,000. Michelle Clark, independent accountant who audits the company’s accounts and performs consulting services, $16,500; gross amounts paid...
Use the percentage method to compute the federal income taxes to withhold from the wages or salaries of each employee. If an amount is zero, enter "0". Round your calculations and final answers to the nearest cent. Table of Allowance Values for 2019 Weekly 80.80 Biweekly 161.50 Semimonthly 175.00 Monthly 350.00 Quarterly 1,050.00 Semiannual 2,100.00 Annual 4,200.00 Daily/Misc. 16.20 The following tables were in effect during 2019. Table of Allowance Values Payroll Period One Withholding Allowance Weekly $ 80.80 Biweekly...
Y ou are 35 years old You have a non-working spouse (same age) You have one child, age 3 Annual gross income S110,000 Your monthly expenses total S3,500 Monthly debt payments are S400 (counted in the S3,500) Tax-specific Information Adjusted gross income- S75,500 Itemized deductions-$15,500 Child care tax credit = $500 Federal income tax withheld S6,250 Amount for personal exemptions- S12,500 The kids are getting too big for your apartment, so it's time to buy a house! Your bank is...
Alexander Wilson operates Metroplex Courier and Delivery Service. He has four employees who are paid on an hourly basis. During the workweek beginning December 15 and ending December 21, 2019, his employees worked the number of hours shown below Information about their hourly rates, marital status, and withholding allowances also appears below, along with their cumulative earnings for the year prior to the December 15-21 payroll period. Consider any hours worked beyond 40 in the week as overtime hours and...
Nashville Publishing Company pays its employees monthly. Payments made by the company on October 31, 2019, follow. Cumulative amounts paid to the persons named prior to October 31 are also given. 1. Paul Parker, president, gross monthly salary of $20,100; gross earnings prior to October 31, $171,400. 2. Carolyn Wells, vice president, gross monthly salary of $16,300; gross earnings paid prior to October 31, $152,400. 3. Michelle Clark, independent accountant who audits the company's accounts and performs consulting services, $16,200;...
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...