how do i write this program in c++? thanks Program3 Instructions: Use named cons
ID: 3751547 • Letter: H
Question
how do i write this program in c++?
thanks
Program3 Instructions: Use named constants where appropriate, for example the tax rate percent, the senior exemptions, and the disability exemptions. Prompt for: Tax zone Assessed value of a home If they have a qualified disability Property tax calculation rule is as follows: The assessed value entered is reduced by the senior exemption first if the taxpayer is eligible. Then the remaining amount of the assessed value (if reduced), is further reduced by the disability exemption if the taxpayer qualifies. Then the final remaining assessed value (if reduced) is then multiplied by the tax rate percent based on the tax zone the taxpayer is in. The result is the amount of property tax due. See the table below for required values. Property tax zone County Tax Rate Percent Senior Exemption Must be 65 or older Dallas Denton Johnson Tarrant 2.173% 2.091% 1.727% 2.321% 15,000 13,000 10,000 $ 10,000 Disability Exemption Must be 55 or older and disabled 2% 2.5% 1.9% 2.3% You must implement a Switch structure and use the property tax zone values as the case value. The if statements required to determine the exemptions will be coded in each case choice within the Switch structure. The required input and output design can be seen below using sample data. Be sure to test all possible scenarios with different values to ensure the program works correctly. LEASE ENTER YOUR TAX ZONE: LEASE ENTER THE ASSESSED UALUE OF YOUR HOME: 208000 LEASE ENTER YOUR GE: IP YOU HAUE A QUALIFIED DISABILITY ENTER Y? y 65 PROPERTY TAX REPORT Dallas County Assessed Ualue: Tax Rate: Senior Exenption: Disability Exenption Your total exenptions are Adjusted Assessed Ualue: Tax Bil1 Due: $ 200000. 2.173x Anount: 15808.80 Arount : 3700.08 18780.00 181300.00 939.65 ress any key to continueExplanation / Answer
ScreenShot
--------------------------------------------------
Program
//Header file
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
//Constants declaration
const string county1 = "Dallas", county2 ="Denton", county3 = "Johnson", county4 = "Tarrant";
const double taxRate1 = 2.173, taxRate2 = 2.091, taxRate3 = 1.727, taxRate4 = 2.321;
const int seniorExcemption1 = 15000, seniorExcemption2 = 13000, seniorExcemption3 = 10000, seniorExcemption4 = 10000;
const double disableException1 = 2.00, disableException2 = 2.5, disableException3 = 1.9, disableException4 = 2.3;
//main method
int main()
{
//Vaariables
int zone,age;
double homeValue,disableException=0;
char disability;
//Input section
cout << "PLEASE ENTER YOUR TAX ZONE: ";
cin >> zone;
cout << "PLEASE ENTER THE ASSESSED VALUE OF YOUR HOME: ";
cin >> homeValue;
cout << "PLEASE ENTER YOUR AGE: ";
cin >> age;
cout << "IF YOU HAVE A QUALIFIED DISABILITY ENTER y?: ";
//Output section
cin >> disability;
cout << " PROPERTY TAX REOPRT ";
cout << "--------------------------------------------------------------------------------------------- ";
//According to zone
switch (zone) {
//If zone==1
case 1:
cout << "County: " << county1<<endl;
cout << "Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax rate: " << fixed << setprecision(3) << taxRate1 << "%" << endl;
if (age >= 65) {
cout << "Senior Excemption: y Amount: $ " << fixed << setprecision(2) << seniorExcemption1 << endl;
homeValue = homeValue - seniorExcemption1;
}
if (disability == 'y') {
disableException = homeValue * disableException1 / 100;
cout << "Disability Excemption: y Amount: $ " << fixed << setprecision(2) << disableException << endl;
homeValue = homeValue - disableException;
}
cout << "Your total exceptions are: " << fixed << setprecision(2) << seniorExcemption1 + disableException << endl;
cout << "Adjested Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout<<"Tax Bill Due: $ " << fixed << setprecision(2) << homeValue*taxRate1/100 << endl<<endl;
break;
//If zone==2
case 2:
cout << "County: " << county2 << endl;
cout << "Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax rate: " << fixed << setprecision(3) << taxRate2 << "%" << endl;
if (age >= 65) {
cout << "Senior Excemption: y Amount: $ " << fixed << setprecision(2) << seniorExcemption2 << endl;
homeValue = homeValue - seniorExcemption2;
}
if (disability == 'y') {
disableException = homeValue * disableException2 / 100;
cout << "Disability Excemption: y Amount: $ " << fixed << setprecision(2) << disableException << endl;
homeValue = homeValue - disableException;
}
cout << "Your total exceptions are: " << fixed << setprecision(2) << seniorExcemption2 + disableException << endl;
cout << "Adjested Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax Bill Due: $ " << fixed << setprecision(2) << homeValue * taxRate2 / 100 << endl << endl;
break;
//If zone==3
case 3:
cout << "County: " << county3 << endl;
cout << "Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax rate: " << fixed << setprecision(3) << taxRate3 << "%" << endl;
if (age >= 65) {
cout << "Senior Excemption: y Amount: $ " << fixed << setprecision(2) << seniorExcemption3 << endl;
homeValue = homeValue - seniorExcemption3;
}
if (disability == 'y') {
disableException = homeValue * disableException3 / 100;
cout << "Disability Excemption: y Amount: $ " << fixed << setprecision(2) << disableException << endl;
homeValue = homeValue - disableException;
}
cout << "Your total exceptions are: " << fixed << setprecision(2) << seniorExcemption3 + disableException << endl;
cout << "Adjested Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax Bill Due: $ " << fixed << setprecision(2) << homeValue * taxRate3 / 100 << endl << endl;
break;
//If zone==4
case 4:
cout << "County: " << county4 << endl;
cout << "Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax rate: " << fixed << setprecision(3) << taxRate4 << "%" << endl;
if (age >= 65) {
cout << "Senior Excemption: y Amount: $ " << fixed << setprecision(2) << seniorExcemption4 << endl;
homeValue = homeValue - seniorExcemption4;
}
if (disability == 'y') {
disableException = homeValue * disableException4 / 100;
cout << "Disability Excemption: y Amount: $ " << fixed << setprecision(2) << disableException << endl;
homeValue = homeValue - disableException;
}
cout << "Your total exceptions are: " << fixed << setprecision(2) << seniorExcemption4 + disableException << endl;
cout << "Adjested Assessed Value: " << fixed << setprecision(2) << homeValue << endl;
cout << "Tax Bill Due: $ " << fixed << setprecision(2) << homeValue * taxRate4 / 100 << endl << endl;
break;
//Otherwise
default:
cout << "Entered zone is wrong!!!!" << endl;
break;
}
return 0;
}
------------------------------------------------
Output
PLEASE ENTER YOUR TAX ZONE: 1
PLEASE ENTER THE ASSESSED VALUE OF YOUR HOME: 200000
PLEASE ENTER YOUR AGE: 65
IF YOU HAVE A QUALIFIED DISABILITY ENTER y?: y
PROPERTY TAX REOPRT
---------------------------------------------------------------------------------------------
County: Dallas
Assessed Value: 200000.00
Tax rate: 2.173%
Senior Excemption: y Amount: $ 15000
Disability Excemption: y Amount: $ 3700.00
Your total exceptions are: 18700.00
Adjested Assessed Value: 181300.00
Tax Bill Due: $ 3939.65
Press any key to continue . . .
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.