Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I got error from the homework website for only one difference. The website requires me to format the diffference and difference (percent) to one decimal

I got error from the homework website for only one difference. The website requires me to format the diffference and difference (percent) to one decimal when the income=8000, and the output of difference and difference(percent) is 0. The rest of my code works, but it didn't work when the output is 0 because I cannot format only this output to one decimal place while others remains two decimals.

My code:

def Tax2017(income): tax = 0.0 if income=9326 and income=37951 and income=91901 and income=191651 and income=416701 and income

def Tax2018(income): tax = 0.0 if income=9526 and income=38701 and income=82501 and income=157501 and income=200001 and income

Result from homework website

image text in transcribed

| This diff is colored to make it clear what parts of the output that are wrong. Green indicates things in the correct output that you are missing. red indicates things in your output tha shouldn't be there The character refers to newlines, so the green-character refers a newline you are missing in your output and the red refers to a newline you need to remove from your output. Enter income as an intceer with no comnas: Income: 8008 2017 tax: 800.0 2018 tax: 00.0 Difference: 3.8 Difference (percent): Fnter incomras an intrerrwith no romnas: Tncome: 1500 2017 tax: 1783.75 2018 tax 1609.5 Difference: -174.25 Differene (percer) 9.77 Enter income as an integer with no commas: Income: 4088 2817 tax: 5738.75 2018 tax 4739.5 Difference: -999.25 Difference (percent) 17.41 Enler inome as a inleger wilhas:Iicme 188880 2817 tax: 2 981.75 2818 tax: 18289.5 Difference: 2692.25 Difference (percent): 12.83 Enter income as an integer ith no commas Income: 280888 2817 Lax: 49399.25 818 tax: 45689.5 Differcncc: 3709.75 Difference (percent 7,51 Enter income as an integer with no commas: Income: 588880 2817 tax: 153818.35 2818 Lax: 158689.5 Difference: -3129.35 Difference (percent) 2.93 Enter income as an integer with no comnas: Income: 1088000 2017 tax: 351818.85 2018 tax: 335689.5 Ditterence: -16129.35 Difference (percent): 4.58

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logics For Databases And Information Systems

Authors: Jan Chomicki ,Gunter Saake

1st Edition

1461375827, 978-1461375821

More Books

Students also viewed these Databases questions