Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help! Computer Science python programming code this is my code I have a problem if invalid data is entered terminate the program with an

Please help! Computer Science python programming code

image text in transcribed

this is my code I have a problem if invalid data is entered terminate the program with an error message, and Show two decimal point.

my code

print("%-70s"%("Input your First Name :"), end="") fname=input() print("%-70s"%("Input your Last Name :"), end="") lname=input() fullname=fname+""+lname fullname2=lname+", "+fname print("%s%s%-65s"%(fname,","," What is your taxable income:"), end="") income=float(input())

if income>=0 : income=float(income) else : print(" You are typed wrong alphbat") exit(0)

print("%-70s"%("What is your filing status? (Enter S for single or J for joint):"), end="") filing=input() Tax=0 if(filing=="s" or filing=="S"): filing="Single" if(1710>income): Tax=0 elif(20930>income): Tax=87.00+(income*0.03) elif(28790>income): Tax=742.40+(income*0.08) elif(20930 Tax=1449.60+(income*0.11) elif(filing=="j" or filing=="J"): filing="Joint" if(3420>income): Tax=0 elif(47120>income): Tax=330.00+(income*0.04) elif(57580>income): Tax=1905.40+(income*0.09) elif(57580.00 Tax=2899.20+(income*0.11) else: print("You typed wrong input") exit(0) NetS=income-Tax print("%-25s%-15s%-15s%-15s%s"%("Name", "Status", "Gross Salary", "Taxes", "Net Salary")) print("================================================================================") print("%-25s%-15s%8.2f%s%-15s%8.2f%-15s%s%8.2f%s"%(fullname2, filing, "$",income, "$",Tax, "$",NetS))

The program must include an Id block, analysis and detailed algorithm as a comment block; refer to the sample output for the format. Demo the program in the lab to your instructor to get full credit. Write a program to read a person's name, filing status, and taxable income and write their state income tax. Verify salary (positive numbers only) and status (can only be joint or single), if invalid data is entered terminate the program with an error message. Pay special attention as how the tax is calculated. Below is a made up state Tax Tables SINGLE TAXPAYERS If The Taxable Income IsComputed Tax Is But Not Over $1710 $20930 $28790 And over Of Amount Over Over $0 S1710 $20930 $28790 No Tax $87.00 $742.40 3.0% 8.0% 1 1 .0% S1710 20930 S28790 $1449.60 Computed Tax Is If The Taxable Income Is Over But Not Over $3420 $47120 S57580 And over Of Amount Over SO S3420 S47120 $57580 No Tax S330.00 S1905.40 S2899.20 us us us 4.0% 9.0% 1 1 .0% S3420 S47120 $57580 Below is a sample output: Program Number 3 Joseph Kardian Computer Science 14 Enter your name: Joseph Joseph, enter your taxable income: $539590.00 What is your filing status? (Enter S for single or J for joint): J Kardian Status Gross Salary Taxes Net Salary Name Kardian, Joseph Joint S539590.00 $55920.30 $483669.70

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions