You are on page 1of 4

Result:

Code:

#Madison Barnett

#CSC 110

#This program will determine whether or not

#the specified CPU is within one of four

#categories: high-performance, medium-performance,

#low-performance, and in need of an upgrade.

print("-----------------------------")

print("----- WHERE'S THE MONEY -----")

print("-----------------------------")

tax_limit = False

salary = input("What is your annual salary?\n")

if salary.isnumeric() == True:

rent = input('How much is your monthly mortgage or rent?\n')


if rent.isnumeric() == True:

bills = input("What do you spend on bills monthly?\n")

if bills.isnumeric() == True:

food = input("What are your weekly grocery/food expenses?\n")

if food.isnumeric() == True:

travel = input("How much do you spend on travel annually?\n")

if travel.isnumeric() == True:

salary =int(salary)

rent =int(rent)

bills =int(bills)

food =int(food)

travel =int(travel)

if salary <= 15000:

tax = 10

if salary > 15000 and salary <= 75000:

tax = 20

if salary > 75000 and salary <= 200000:

tax = 25

if salary >200000:

tax = 30

annual_tax = salary * (tax/ 100.0)

if annual_tax > 50000:

annual_tax = 50000

tax_limit = True

annual_rent = rent *12

annual_bills = bills *12

annual_food = food * 52

annual_extra = (salary - annual_rent - annual_bills - annual_food


- travel - annual_tax)

rent_p = (annual_rent / salary) * 100

bills_p = (annual_bills / salary) * 100

food_p = (annual_food / salary) * 100

travel_p = (travel / salary) * 100

tax_p = (annual_tax / salary) * 100

extra_p = (annual_extra / salary) * 100

multiply = max(int(rent_p), int(bills_p), int(food_p), int(travel_p),

int(tax_p), int(extra_p))

print("")

print("------------------------------------------" + '-' * multiply)

print("See the financial breakdown below, based on a salary of $" +str(salary))

print("------------------------------------------" + '-' * multiply)

print("| mortgage/rent | $ "+ format(annual_rent, ' 10,.2f') + ' | ' + format(rent_p, '5.1f')+ '%
| ' + '#' *int(rent_p))

print("| bills | $ "+ format(annual_bills, '10,.2f') + ' | ' + format(bills_p, '5.1f')+ '% | ' + '#'
*int(bills_p))

print("| food | $ "+ format(annual_food, '10,.2f') + ' | ' +format(food_p, '5.1f') + '% | ' +
'#' *int(food_p))

print("| travel | $ "+ format(travel, '10,.2f') + ' | ' +format(travel_p, '5.1f') + '% | '+ '#'
*int(travel_p))

print("| tax | $ "+ format(annual_tax, '10,.2f') + ' | ' +format(tax_p, '5.1f') + '% | '+ '#'
*int(tax_p))

print("| extra | $ "+ format(annual_extra, '10,.2f') + ' | ' +format(extra_p, '5.1f') + '% | '+
'#' *int(extra_p))

print("------------------------------------------" + '-' * multiply)

if annual_extra < 0:

print(">>> WARNING: DEFICIT <<<")

if tax_limit == True:
print(">>> TAX LIMIT REACHED <<<")

else:

print("Must enter positive integer for travel.\n")

else:

print("Must enter positive integer for food.\n")

else:

print("Must enter positive integer for bills.\n")

else:

print("Must enter positive integer for mortgage or rent.\n")

else:

print("Must enter positive integer for salary.\n")

You might also like