fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9. double propValue, //Property Value
  10. assessment, //Assessment
  11. srAssessment, //Sr Assessment
  12. taxRate, //Tax rate
  13. annualPropTax, //Annual Property tax
  14. quarterlyTax; //Quarterly Tax
  15.  
  16. string name;
  17.  
  18. const double EXEMPT = 5000, //shows the total after exemption
  19. QUARTER = 4, //represents the amount of quarters in a year
  20. TAXPERHUNDRED = 0.01, //represents tax rate for every $100
  21. SIXTYPERCENT = 0.6; //Represents the tax based on 60% of original value
  22.  
  23.  
  24. //Gets name from user
  25. cout << "Please enter your full name: ";
  26. getline(cin, name);
  27.  
  28. //gets property value from user
  29. cout << "Enter the actual value of the property: ";
  30. cin >> propValue;
  31.  
  32.  
  33. //Gets tax rate
  34. cout << "Enter the tax rate for each $100 of assessed value: ";
  35. cin >> taxRate;
  36.  
  37. cout << endl << endl;
  38.  
  39. //Calculates assessment
  40. assessment = propValue * SIXTYPERCENT;
  41.  
  42. //Calculates Sr. Assessment
  43. srAssessment = assessment - EXEMPT;
  44.  
  45. //Calculates annual property tax
  46. annualPropTax = srAssessment * taxRate * TAXPERHUNDRED;
  47.  
  48. //Calculates Quarterly tax
  49. quarterlyTax = annualPropTax / QUARTER;
  50.  
  51.  
  52. //Displays owners name
  53. cout << "Property owner's name: " << name << endl;
  54. cout << endl;
  55.  
  56. cout << setprecision(2) << fixed;
  57. //Displays Assesment
  58. cout << "Assessment: " << setw(18) << "$ " << setw(10) << std::right << srAssessment << endl;
  59.  
  60. //Displays Annual Property tax
  61. cout << "Annual Property Tax" << setw(11) << "$ " << setw(10) << std::right << annualPropTax << endl;
  62.  
  63. //Displays Quarterly Property tax
  64. cout << "Quarterly Property Tax" << setw(8) << "$ " << setw(10) << std::right << quarterlyTax;
  65. cout << endl << endl;
  66.  
  67.  
  68.  
  69. /*
  70. This is the current output
  71.  
  72. Assessment: $ 175000.00
  73. Annual Property Tax $ 7177.50
  74. Quarterly Property Tax $ 1780.63
  75.  
  76.  
  77.   What i need it to do is display as so:
  78.  
  79. Assessment: $ 175000.00
  80. Annual Property Tax $ 7177.50
  81. Quarterly Property Tax $ 1780.63
  82.  
  83. */
  84. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Please enter your full name: Enter the actual value of the property: Enter the tax rate for each $100 of assessed value: 

Property owner's name: 

Assessment:                 $   -5001.05
Annual Property Tax         $       0.00
Quarterly Property Tax      $       0.00