代码不起作用。我认为这可能与常量“ TAX_FACTOR = 0.0070”中的浮点有关。代码为:
ShowTax() {
local TAX_FACTOR=0.0070
echo "Enter the property's value."
read propertyValue
tax=$((expr $propertyValue*$TAX_FACTOR )) #there is a problem
echo "The property tax is:" "$tax"
}
# Main
echo " Enter lot number of property or 0 to end"
read lotNumber
while(( $lotNumber != 0 ));do
showTax
echo "Enter the lot number for the next property or 0 to end"
read lotNumber
done