Answer to Question #264897 in C++ for Rille

Question #264897

9. The Area of a Rectangle = L * W, where L=length and W=width. Make a program that will input Length and Width, compute and display the Area. Your program will be terminated to have an option to quit processing another entry.





Salary rate/year Tax Percentage deduction



Lesser than 500,000.00 10%



500,000.00 25%



501,000.00 and above 30%




Make a program that will input salary (for one year, Check the salary rate at what range it belongs, process the tax deduction and display the tax amount. Your program will be terminated when you input zero in the salary.



Ex. Salary: 450000.00



Tax deduction amount: 45000.00




1
Expert's answer
2021-11-15T00:20:11-0500
#include<iostream>
using namespace std;
int main(){
	int l, w;
	int x;
	do{
		cout<<"Enter the width:  "<<endl;
	cin>>l;
	cout<<"Enter the length:  "<<endl;
	cin>>w;
	cout<<"The area of rectangle is: "<<l * w<<endl;
	cout<<"Enter 2  to stop the program or 1 to continue \n"<<endl;
	cin>>x;
	} while(x !=2);
	
}
#include<iostream>
using namespace std;
int main(){
	int salary;
	int x;
	do{
		cout<<"Enter the salary: \n";
		cin>>salary;
		if(salary<500000){
			cout<<"Tax deduction amount:  "<<salary * 0.1<<endl;
		}
		else if(salary==500000){
			cout<<"Tax deduction amount:  "<<salary * 0.25<<endl;
		}
		else if(salary>500000){
			cout<<"Tax deduction amount:  "<<salary * 0.3<<endl;
		}
		cout<<"Enter 2  to stop the program or 1 to continue \n"<<endl;
	cin>>x;
	} while(x !=2);
	
}

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

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS