Programming Exercise 3-1
Programming Exercise 5-5
# Global constants for property tax
ASSESS_PERCENT = 0.6
PROPERTY_TAX_PERCENT = 0.0072
# main function
def main():
# Local variables
actualValue = 0.0
assessValue = 0.0
propertyTax = 0.0
# Get the actual value.
actualValue = float(input(‘Enter the actual value: ‘))
# Calculate the assessed value.
assessValue = actualValue * ASSESS_PERCENT
# Calculate the property tax.
propertyTax = assessValue * PROPERTY_TAX_PERCENT
# Print information about property tax.
showPropertyTax(assessValue, propertyTax)
# The showPropertyTax function accepts the assessment
# value and the property tax value as arguments and
# displays the property tax information.
def showPropertyTax (assessValue, propertyTax):
print (‘Assessed value: $’, \
format(assessValue, ‘,.2f’), sep=”)
print (‘Property tax: $’, \
format(propertyTax, ‘,.2f’), sep=”)
# Call the main function.
main()
_1254873575.vsd
main()
getActual
(actualValue)
setPropertyTax
(assessValue,
propertyTax)
End
Declare
actualValue,
assessValue,
propertyTax
getActual
(Ref actualValue)
Return
Display “Enter
the actual
value”
Input
actualValue
showPropertyTax
(assessValue,
propertyTax)
Return
Display
“Assessed Value: $”, assessValue
“Property Tax: $”, propertyTax
Global Constant Real
ASSESS_PERCENT
PROPERTY_TAX_PERCENT
setAssess
(actualValue,
assessValue)
setAssess
(actualValue, Ref
assessValue)
Return
assessValue =
actualValue *
ASSESS_PERCENT
showPropertyTax
(assessValue,
propertyTax)
setPropertyTax
(assessValue,
Ref propertyTax)
Return
propertyTax = assessValue *
PROPERTY_TAX_PERCENT
main()
getActual
(actualValue)
setPropertyTax
(assessValue, propertyTax)
End
Declare
actualValue, assessValue, propertyTax
getActual
(Ref actualValue)
Input
actualValue
showPropertyTax (assessValue, propertyTax)
Return
Return
Display “Enter the actual value”
Display
“Assessed Value: $”, assessValue
“Property Tax: $”, propertyTax
Global Constant Real ASSESS_PERCENT PROPERTY_TAX_PERCENT
setAssess
(actualValue, assessValue)
setAssess
(actualValue, Ref assessValue)
Return
assessValue = actualValue * ASSESS_PERCENT
showPropertyTax
(assessValue, propertyTax)
setPropertyTax
(assessValue,
Ref propertyTax)
Return
propertyTax = assessValue * PROPERTY_TAX_PERCENT