TAX_RATE = 0.5

def actOnPersonalInformation(age,name):
    if (age >= 18):
        print("%s you an adult at at %d" %(name,age), end = " ")
    else:
        print("%s you are %d" %(name,age), end = " ")
    print("years old")

def displayTaxInformation(income,deductions,taxableIncome,tax,afterTaxIncome):
    i = -1
    print("\nTAX CALCULATIONS")
    print("Total income $%.1f" %(income))
    print("-<Tax deductions $%.1f>" %(deductions))
    print("Taxable income $%.1f" %(taxableIncome))    
    for i in range(1,24,1):
        print("-", end="")
    print()
    print("-<Taxes paid $%.1f>" %(tax))
    print("After tax income $%.1f" %(afterTaxIncome))   

def getFinancialData():
    income = -1
    deductions = -1
    income = float(input("Income $"))
    deductions = float(input("Income deductions $"))
    return(income,deductions)

def getPersonalInformation():
    age = -1
    name = ""
    age = int(input("Age (0-114): "))
    name = input("Name: ")
    return(age,name)

def calculateTax(income,deductions):
    taxableIncome = income - deductions
    tax = taxableIncome * TAX_RATE
    afterTaxIncome = income - tax
    return(taxableIncome,tax,afterTaxIncome)

def processPersonalInformation():
    age = -1
    name = ""
    i = -1
    age,name = getPersonalInformation()
    actOnPersonalInformation(age,name)
    for i in range(1,11,1):
        print("*", end="")
    print("\n")

def processTaxes():
    income = -1
    deductions = -1
    taxableIncome = -1
    tax = -1
    afterTaxIncome = -1
    income,deductions = getFinancialData()
    taxableIncome,tax,afterTaxIncome = calculateTax(income,deductions)
    displayTaxInformation(income,deductions,taxableIncome,tax,afterTaxIncome)

def start():
    #processPersonalInformation()
    processTaxes()



start()
