// Renee V. Lopez CS1A Chapter 3, P. 145, #14
/*******************************************************************************
* CALCULATE SENIOR PROPERTY TAX
* _____________________________________________________________________________
* This program determines the annual property tax for senior homeowners by
* applying a $5,000 exemption and calculates the quarterly payment based on
* the resulting annual tax.
* _____________________________________________________________________________
* INPUT
* propVal - The total value of the property
* taxRate - The tax rate applied per $100 of assessed value
*
* OUTPUT
* propTax - The annual property tax amount after applying the senior
* exemption
* quarterPay - The amount due each quarter based on the annual property tax
*
******************************************************************************/
#include <iostream>
#include <iomanip> // For formatting output to two decimal places
using namespace std;
int main()
{
// Variable declarations for input
float propVal; // The value of the property
float taxRate; // The tax rate per $100 of assessed value
// Variable declarations for output
float assessedVal; // The assessed value of the property
float propTax; // The calculated annual property tax after the exemption
float quarterPay; // The amount of tax due each quarter
// Define the senior citizen exemption amount
const float SENIOR_EXEMP = 5000.0;
// Prompt user for input values
cout << "Enter the value of your house: ";
cin >> propVal;
cout << "Enter the tax rate per $100 of assessed value: ";
cin >> taxRate;
// Compute the assessed value of the property
assessedVal = propVal * 0.6;
// Calculate the annual property tax after applying the exemption
propTax = ((assessedVal - SENIOR_EXEMP) / 100) * taxRate;
// Compute the quarterly tax payment
quarterPay = propTax / 4;
// Output the results with two decimal places
cout << fixed << setprecision(2); // Ensure two decimal places in output
cout << "Your annual property tax is $" << propTax << ".\n";
cout << "Your quarterly tax bill is $" << quarterPay << ".\n";
return 0;
}