Answered step by step
Verified Expert Solution
Question
1 Approved Answer
employee_data = [ [Willena Shupe, 68380, 77787.85, M, 9324.5, 8992.33, 238 EAST 4TH STREET, , 10009, 995-90-3822, 8/29/1982], [Jolanda Agin, 129375, 131235.09, S, 29206.75, 20876.00,
employee_data = [ ["Willena Shupe", 68380, 77787.85, "M", 9324.5, 8992.33, "238 EAST 4TH STREET", "", "10009", "995-90-3822", "8/29/1982"], ["Jolanda Agin", 129375, 131235.09, "S", 29206.75, 20876.00, "303 EAST 4TH STREET", "", "10009", "118-64-4959", "4/3/1988"], ["Leta Stacker", 172189, 194093.7, "S", 41194.67, 0, "715 EAST 5TH STREET", "", "10009", "345-57-6947", "4/17/1951"], ["Leonora Oliverio", 203796, 210209.32, "M", 43947.38, 39029.24, "274 EAST SEVENTH STREET", "", "10009", "632-40-1953", "11/14/1967"], ["Birgit Stoudt", 168418, 198681.66, "M", 34041.54, 36262.60, "241 EAST 2ND STREET", "", "10009", "497-60-1619", "7/23/1960"], ["Aron Valtierra", 196695, 228767.42, "M", 41959.1, 43483.18, " 101 AVENUE D", "B", "10009", "428-06-1846", "7/23/1971"], ["Vi Buschman", 39486, 44724.88, "S", 5610.25, 0, " 101 AVENUE D", "C", "10009", "311-11-3801", "8/15/1963"], ["Janee Barnwell", 85387, 86141.32, "S", 17085.5, 0, "211 EAST 3RD STREET", "5F", "10009", "759-79-3369", "11/12/1951"], ["Agnus Flower", 241532, 280832.58, "M", 54922.56, 55978.82, "211 EAST 3RD STREET", "6R", "10009", "034-60-0074", "3/8/1983"], ["Byron Mccartney", 141893, 169887.13, "S", 32711.79, 0, "525 EAST 11TH STREET", "PH8A", "10009", "279-59-7120", "4/2/1976"], ["Victoria Crabill", 90472, 92154.42, "S", 18356.75, 0, "122 AVENUE C", "", "10009", "051-96-0241", "9/21/1972"], ["Amy Swinton", 37773, 41928.75, "S", 5199.7, 0, "650 EAST 6TH STREET", "", "10009", "757-08-5403", "7/23/1958"], ["Arla Mohamed", 161207, 189347.41, "M", 32022.46, 34022.38, "650 EAST 6TH STREET", "", "10009", "177-67-0119", "8/25/1961"], ["Bryon Vester", 77589, 92661.19, "S", 15136, 0, "137 AVENUE C", "", "10009", "806-26-4077", "1/31/1969"], ["Lue Benway", 183887, 216939.19, "M", 38372.86, 40644.41, "165 AVENUE B", "", "10009", "156-08-0769", "2/2/1959"], ["Mozelle Macauley", 504320, 585134.36, "M", 165652.32, 156176.03, "753 EAST 5TH STREET", "2A", "10009", "500-80-0880", "11/28/1965"], ["Suzann Galindo", 64709, 74014.6, "S", 11916, 0, "753 EAST 5TH STREET", "4B", "10009", "042-28-9287", "3/19/62"], ["Delicia Barriere", 149387, 174949.85, "M", 28824.25, 30566.96, "366 EAST 8TH STREET", "2", "10009", "414-23-2859", "8/17/1964"], ["Marcella Uyehara", 61498, 62479.06, "S", 11113.25, 0, "643 EAST 11 STREET", "5", "10009", "340-03-4917", "1/20/1975"], ["Jane Curley", 92920, 109376.38, "S", 18999.35, 0, "205 8 AVENUE", "", "10011", "073-49-0558", "9/28/1989"]] T1=0.0 T2=0.0 RATE1=0.10 RATE2=0.12 RATE3=0.22 RATE4=0.24 RATE5=0.32 RATE6=0.35 RATE7=0.37 RATE1_SINGLE=9525.0 RATE2_SINGLE=38700.0 RATE3_SINGLE=82500.0 RATE4_SINGLE=157500.0 RATE5_SINGLE=200000.0 RATE6_SINGLE=500000.0 RATE1_MARRIED=19050.0 RATE2_MARRIED=77400.0 RATE3_MARRIED=165000.0 RATE4_MARRIED=315000.0 RATE5_MARRIED=400000.0 RATE6_MARRIED=600000.0 print("%-20s%-20s%-20s%-10s"%("NAME","SALARY 2018","MARITAL STATUS","TAX 2018")) for i in range(len(employee_data)): if employee_data[i][5]==0: if employee_data[i][3] == "s": if employee_data[i][2] <= RATE1_SINGLE: T1 = RATE1 * employee_data[i][2] elif (employee_data[i][2] <= RATE2_SINGLE): T1 = 952.50 T2 = RATE2 * (employee_data[i][2]-RATE2_SINGLE) elif (employee_data[i][2] <= RATE3_SINGLE): T1 = 4453.0 T2 = RATE3 * (employee_data[i][2]-RATE3_SINGLE) elif (employee_data[i][2] <= RATE4_SINGLE): T1 = 14089.50 T2 = RATE4 * (employee_data[i][2]-RATE4_SINGLE) elif (employee_data[i][2] <= RATE5_SINGLE): T1 = 32089.50 T2 = RATE5 * (employee_data[i][2]-RATE5_SINGLE) elif (employee_data[i][2] <= RATE6_SINGLE): T1 = 45689.50 T2 = RATE6 * (employee_data[i][2]-RATE6_SINGLE) elif (employee_data[i][2] > RATE6_SINGLE): T1 = 150689.50 T2 = RATE7 * (employee_data[i][2]-RATE6_SINGLE) else: if (employee_data[i][2] <= RATE1_MARRIED): T1 = RATE1 * employee_data[i][2] elif (employee_data[i][2] <= RATE2_MARRIED): T1 = 1905.0 T2 = RATE2 * employee_data[i][2] elif (employee_data[i][2] <= RATE3_MARRIED): T1 = 8907.0 T2 = RATE3 * employee_data[i][2] elif (employee_data[i][2] <= RATE4_MARRIED): T1 = 28179.0 T2 = RATE4 * employee_data[i][2] elif (employee_data[i][2] <= RATE5_MARRIED): T1 = 64179.0 T2 = RATE5 * employee_data[i][2] elif (employee_data[i][2] <= RATE6_MARRIED): T1 = 91379.0 T2 = RATE6 * employee_data[i][2] elif (employee_data[i][2] > RATE2_MARRIED): T1 = 161379.0 T2 = RATE7 * employee_data[i][2] employee_data[i][5] = T1+T2 #for k in range(len(SALARY 2018)) print("%-20s%-25s%-15s%-20s"% (employee_data[i][0],'${:,.2f}'.format(employee_data[i][2]),employee_data[i][3],'${:,.2f}'.format(employee_data[i][5]))) ============================================================
This Python code executes fine, i just need to add the sum of the columns and display as below
Salary 2018 and display at the bottom
SALARY 2018
11
12
Total 22
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started