Add radio button options for filing status to the tax calculator program of Project 1. The user selects one of these options to determine the tax rate. The Single option’s rate is 20%. The Married option is 15%. The Divorced option is 10%. The default option is Single.
For the calculations from Project 1, I was gonna use this.
TAX_RATE = 0.20
STANDARD_DEDUCTION = 10000.0
DEPENDENT_DEDUCTION = 3000.0
# Request the inputs gross
Income = float(input("Enter the gross income: "))
numDepend = int(input("Enter the number of dependents: "))
# sets the value for TAX_RATE
option = int(input("Select 1 of these : 1.Single 2.Married 3.Divorced "))
if option == 2 :
TAX_RATE = 0.15
elif option == 3 :
TAX_RATE = 0.10
# Compute the income tax
taxableIncome = grossIncome - STANDARD_DEDUCTION - \
DEPENDENT_DEDUCTION * numDepend
incomeTax = taxableIncome * TAX_RATE
# Display the income tax
print("The income tax is $" + str(incomeTax))
And what I have for implementing this in a GUI is as follows:
from breezypythongui import EasyFrame
class TaxCalculator(EasyFrame):
"""Application window for the tax calculator."""
def __init__(self):
"""Sets up the window and the widgets."""
EasyFrame.__init__(self, title = "Tax Calculator")
# Label and field for the income
# (self.incomeField)
# Label and field for the number of dependents
# (self.depField)
# Radio buttons for filing status
# Button group (self.statusGroup)
# Option for single (self.single)
# Option for married (self.married)
# Option for divorced (self.divorced)
# The compute button
# Label and field for the tax
# (self.taxField)
# The event handler method for the button
def computeTax(self):
"""Obtains the data from the input field and uses
them to compute the tax, which is sent to the
output field (taxField)."""
pass
def main():
TaxCalculator().mainloop()
if __name__ == "__main__":
main()
Thanks
As project 1 is not known ..use the below radio button code in your project of python.
___________________________
# import tkinter for python gui elements
from tkinter import *
# function definition
def tax():
# assuming some amount to find the tax amount
amount = 35000
# if the selected option is 'single' then get 20% of assumed amount
if var.get() == 1:
tax_amt = 0.2 * amount
# if 'married' then 15% of assumed amount
elif var.get() == 2:
tax_amt = 0.15 * amount
# if divorced then 10% of assumed amount
elif var.get() == 3:
tax_amt = 0.1 * amount
# some display text
disp = "Taxable amount based on the selection is : " + str(tax_amt)
# set the label (which is created in the following steps) with the display text
label.config(text = disp)
# prepare a root window
root = Tk()
# name the root window
root.title("Tax calculator")
# mention the dimension of root window
root.geometry("300x200")
# initialize the variable as integer
var = IntVar()
# set the integer value to 1 i.e, first radio button selection by default
var.set(1)
# create buttons and place them in window as required
R1 = Radiobutton(root, text = "Single", variable = var, value = 1)
R1.place(x=50,y=50)
R2 = Radiobutton(root, text = "Married", variable = var, value = 2)
R2.place(x=50,y=80)
R3 = Radiobutton(root, text = "Divorced", variable = var, value = 3)
R3.place(x=50,y=110)
# create button and call the function when this button clicked
calculate_button = Button(root, text="Calculate", command=tax)
calculate_button.place(x=50, y=140)
# create another button to close the window
quit_button = Button(root, text="Quit", command=root.quit)
quit_button.place(x=130, y=140)
# create a label and place it so that the display text in window is displayed as expected
label = Label(root)
label.place(x=20, y=20)
# call mainloop() to start the event
root.mainloop()
________________________________
Add radio button options for filing status to the tax calculator program of Project 1. The...
Instructions: Add radio button options for filing status to the tax calculator program of Project 1. The user selects one of these options to determine the tax rate. The Single option’s rate is 20%. The Married option is 15%. The Divorced option is 10%. The default option is Single. Be sure to use the field names provided in the comments in your starter code. Given Code: It also gives us the code for a module but that is like 3000...
X Programming Exercise 8.6 | Instructions breezypythongui.py taxformwithgui.py + Q Desktop + ve Add radio button options for filing status to the tax calculator program of Project 1. The user selects one of these options to determine the tax rate. The Single option's rate is 20%. The Married option is 15%. The Divorced option is 10%. The default option is Single. 1 2 File: taxformwithgui.py 3 Project 8.6 4 A GUI-based tax calculator. 5 6 Computes and prints the total...
Problem 1-11 The Tax Formula for Individuals, Filing Status and Tax Computation, The Standard Deduction (LO 1.3, 1.5, 1.7) Christine is a single 50-year-old taxpayer with no dependents. Her only income is $40,750 of wages. Calculate her taxable income and her tax liability. Table for the standard deduction Filing Status Standard Deduction Single $ 12,200 Married, filing jointly 24,400 Married, filing separately 12,200 Head of household 18,350 Qualifying widow(er) 24,400 Click here to access the tax tables. Taxable income: ?...
Problem 1-8 The Tax Formula for Individuals, Filing Status and Tax Computation, Personal and Dependency Exemptions (LO 1.3, 1.5, 1.7) Jonathan is a 35-year-old single taxpayer with adjusted gross income in 2019 of $46,300. He uses the standard deduction and has no dependents. Table for the standard deduction Filing Status Standard Deduction Single $ 12,200 Married, filing jointly 24,400 Married, filing separately 12,200 Head of household 18,350 Qualifying widow(er) 24,400 Click here to access the tax tables. a. Calculate Jonathan's...
Problem 1-5 The Tax Formula for Individuals, Filing Status and Tax Computation, The Standard Deduction (LO 1.3, 1.5, 1.7) Diego, age 28, married Dolores, age 27, in 2018. Their salaries for the year amounted to $47,230 and they had interest income of $3,500. Diego and Dolores' deductions for adjusted gross income amounted to $2,000; their itemized deductions were $16,000, and they have no dependents. Table for the standard deduction Filing Status 2018 Standard Deduction Single $ 12,000 Married, filing jointly...
Tax Calculator (conditional flow control)
MATLAB
Tax Calculator (conditional flow control) 0 solutions submitted (max: Unlimited) The simplest income tax calculation for a single person filing federal income taxes in the United States involves applying a standard deduction, personal exemption and marginal tax rates to the annual income of the taxpayer. For tax year 2015, the standard deduction for an individual wasメ300 and the personal exemption was >44Mn, The 2015 tax rates vary by income bracket and are given in...
Linette, a single taxpayer, had the following income and deductions for the tax year 2018 EEB (Click the icon to view the income and deductions.)(Click the icon to view the standard deduction amounts.) (Click the icon to view the 2018 tax rate schedule for the Single filing status.) Read the requirements Requirement a. Compute Linette's taxable income and federal tax liability for 2018 First calculate the gross income, then calculate taxable income and the federal tax lability. (Calculate the tax...
Loriann, a single taxpayer, had the following income and deductions for the tax year 2018: ick he icon to view he income and deductions Click the con towe w the standard deduction amounts ick the con to view the 2018 tax rate schedule for the Single ling status Read the requirements Requirement a. Compute Loriann's taxable income and federal tax liabilty for 2018 First calculate the gross income, then calculale taxable income and the federal tax iability. (Calculate the tax...
Linette, a single taxpayer, had the tollowing income and deductions tor the tax year 2018: C ck the icon to view the income and deductions. Click the icon to v ew the standard deduction amounts 을 (Cick the con to ew the 2018 tax rate schedule or he Single ng status. Read the requirements Requirement a. Compute Linette's taxable income and federal tax liability for 2018. First calculate the gross income, then calculate taxable income and the federal tax liability....
QI:1-17 (book/static) Question Help Distinguish between taxpaying entities and flow through entities from the standpoint of the federal income tax law. entities, such as entities, such as merely pass the income on to a are required to pay income taxes on their taxable income generally do not directly pay income taxes on their taxable income but entity. QI:1-18 (book/static) Question Help Sally and Tom are married, have three dependent children, and file a joint return in 2019. If they have...