Chapter 3 – #15: Property Tax – Tony Gaddis – Starting Out With C++

>_ Problem

A county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. If an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 75¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $45. Write a program that asks for the actual value of a piece of property and displays the assessment value and property tax.

>_ Solution

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
    // Constant Variables
    const float ASSESSMENT_PER = 0.60,
                PROPERTY_TAX_PER = 0.75,
                HUNDRED = 100;

    // Variables
    float total_assessment_value,
          total_property_tax,
          value_of_property;

    // Ask user for actual value of property
    cout << endl;
    cout << "What is that actual value of a property?";
    cin >> value_of_property;

    total_assessment_value = value_of_property * ASSESSMENT_PER;
    total_property_tax = (total_assessment_value / HUNDRED) * PROPERTY_TAX_PER;

    // Display assessment value and property tax.
    cout << setprecision(2) << fixed << right << endl;
    cout << "Property Value:    $";

    cout << setw(12) << value_of_property << endl;
    cout << "Assessment value:  $";

    cout << setw(12) << total_assessment_value << endl;
    cout << "Property Tax:      $";

    cout << setw(12) << total_property_tax << endl;

    cout << endl;

    return 0;
}

>_Get The Book!

>_ Video Walk Through

This video includes a step by step process of how I solve programming challenge #15.

>_That’s it!

Thank you for taking interest in what I do! I hope it was helpful for you as much as it helped me along my journey in learning to code!

>_ Also Check Out:

Category: Starting Out With C++ | Chapter 3 | Programming Challenge Solutions

Leave a Reply