Answer to Question #307896 in C++ for Jasper

Question #307896


Write a program in C++ that prompt a user to input his/her yearly gross income. Your program should display the yearly income and the computed tax due, using the table below. (BIR proposed the following Tax computation, with the following Tax Schedule) 0% on income less than 50000; 15% on income from 50000 to 150000; 25% on income from 150001 to 250000; 35% on income over 250000.


1
Expert's answer
2022-03-08T07:12:31-0500
using namespace std;


/*
	Write a program in C++ that prompt a user to input his/her yearly gross income. 
	Your program should display the yearly income and the computed tax due, using the table below. 
	(BIR proposed the following Tax computation, with the following Tax Schedule) 
	0% on income less than 50000; 
	15% on income from 50000 to 150000; 
	25% on income from 150001 to 250000; 
	35% on income over 250000.
*/


int main()
{
	float GrossSalary,Tax;
	
	cout<<"\n\tEnter Yearly Gross Salary: "; cin>>GrossSalary;
	if(GrossSalary<50000)							Tax = 0;
	if(GrossSalary>=50000 && GrossSalary<=150000)	Tax = (150000-GrossSalary)*0.15;
	if(GrossSalary>150000 && GrossSalary<=250000)	Tax = (250000-GrossSalary)*0.25;
	if(GrossSalary>=250000)							Tax = GrossSalary*0.35;
	
	cout<<"\n\tTax = "<<Tax;
	return(0);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

jasper
08.03.22, 14:31

THANK YOU

Leave a comment

LATEST TUTORIALS
New on Blog