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.
#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);
}
Comments
Leave a comment