Answer to Question #298460 in C++ for WLim

Question #298460

 The total price of a product is the price of the product plus the sales tax. Suppose the sales tax is 6%. Write a C++ program that reads the price of the product and displays the total cost of the product.


1
Expert's answer
2022-02-16T08:10:24-0500
#include<iostream>

using namespace std;

int main()
{
	float salTax=0.06;
	float price;
	do
	{
		cout<<"Please, enter the price of the product (0 - exit program): ";
		cin>>price;
		if(price>0)
			cout<<"The total cost of the product is "<<price+0.06*price<<endl; 
	}while(price>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

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog