I'm told you are never to old to learn something new but right now I don't believe that. I thought I understood this but the program I wrote just doesn't work any suggestions?
Write a program that asks the user to enter the price of an item and the sales tax rate as a percent. The program should display th total price of the item (price plus sales tax) After obtaining the input from the user, the program should use the *=
operator to calculate the total price of the item using the equivalent of the following formulaprice=price*( 1 +sales_tax_rate)
This program calculates Total price of the item (price+sales tax).
#include <iostream.h>
#include<iomanip.h>
//using namespace std;
int main()
{
const price*=sales_tax_rate,
price of item,
sales_tax,
total;
//Display price of item
cout<<"\n Enter the price of the item;
cin>> item_price
//calculate tax
sales_tax=item price*sales_tax_rate;
total= item_price + sales_tax;
//Display price and total
cout<<"\n price of item" <<item_price;
cout<<"\nsales tax" <<sales_tax;
cout<<"\n total amount<<total;
return 0;
}