In: Computer Science
python code with screenshot of code and output
Use a function for the taxes. Document all the constants.
what does the program do?
define variables
A county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. For example, if an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 72¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $43.20. Write a program that asks for the actual value of a piece of property and displays the assessment value and property tax
Code -
#function to calculate Assesment value and return it , it take
property value as arguement
def getAssesmentValue(val):
#Assesment value is 60% of property tax
assementVal = (val * 60)/100
#return Assesment value
return assementVal;
#function to calculate property tax , it take Assesment value as
parameter
def getPropertyTax(val):
#calculate propertyTax by dividing Assesment value by 100 and
multipling by 72 cents
propertyTax = (val/100)*72;
#divide propertyTax by 100 to calculate it in $
return propertyTax/100;
def main():
#ask user to enter property value
propertyPrice = int(input("Please enter value of property:
$"))
#get Assesment value take
assementValue = getAssesmentValue(propertyPrice)
#print Assesment value
print("Assesment Value is $"+str(assementValue))
#calculate propertyTax
propertyTax = getPropertyTax(assementValue)
#print property Tax
print("Property Tax is $"+str(propertyTax))
if __name__ == "__main__":
main()
Screenshots -