Programming Challenge Chapter 3 – Q #13 Property Tax – Tony Gaddis – Starting Out With C++

Programming Challenge Chapter 3 – Q #13 Property Tax – Tony Gaddis – Starting Out With C++







Property Tax



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 64¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. 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()

{

      float const ASSESSMENT_PER = 0.60,

            PROPERTY_TAX = 0.64;

 

      float actual_value;

      float total_assessment_value = 0.0, total_property_tax = 0.0;

 

      cout << "What is The Accual Value Of Property?: ";

      cin >> actual_value;

 

      total_assessment_value = actual_value * ASSESSMENT_PER;

      total_property_tax = (total_assessment_value / 100.0) * PROPERTY_TAX;

 

 

      cout << setprecision(2) << showpoint << fixed;

      cout << "Total Assessment Value is   $" << setw(8) << total_assessment_value << endl;

      cout << "Total Property Tax is       $" << setw(8) << total_property_tax << endl;

 

      return 0;

}

This is the solution of this question




OUTPUT OF THIS QUESTION 

Input is highlighted with yellow color.


Explanation of this Solution

  1. Declare two float constants and initialize given values.
  2. Declare a float variable for input.
  3. Declare another two float variable for calculation.
  4. Take input value of property from the user by using cin.
  5. Calculate the values by using given values and values.
  6. Use set precision according to question requirement 
  7.  In last, display output on the screen in a pattern.
  8. Return 0 to the main function.

Also, I attach CPP file of this problem. You can download this file

Click Here to Download This File



Post a Comment

0 Comments