A certain government levies taxes on a person’s total annual income. The taxes are calculated in the given manner.
If a person earns an amount of less than or equal to Rs. 1,00,000 annually, the person is charged 2% of their income as the tax.
If a person earns an amount of more than Rs. 1,00,000 and less than or equal to Rs. 5,00,000, then the person is charged with 2% of Rs. 1,00,000 and 5% on the remaining amount.
If a person earns an amount of more than Rs. 5,00,000, the person is charged with 2% of Rs.1,00,000, 5% of Rs. 4,00,000 and 10% of remaining amount.
The following code snippet computes the total tax to be paid by a person given their annual income.
int income;
cin >> income;
double tax = 0;
if (income <= 100000) tax = blankA1 + blankA2 * income;
else if (income <= 500000) tax = blankB1 + 0.05 * (income - blankB2 );
else tax = blankC1 + blankC2 * (income - 500000);
cout << tax << endl;
Note that, all the blanks are either integer values or double values. They do not involve any variable names. Please only fill your answers as integer or double values.
1.What is the value of blankA1?
2.What is the value of blankA2?
3.What is the value of blankB1?
4.What is the value of blankB2?
5.What is the value of blankC1?
6.What is the value of blankC2?
blankA1=0
blankA2=0.02
blankB1=2000
blankB2=100000
blankC1=22000
blankC2=0.1
Comments
Leave a comment