code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
double item1=15.95, item2=24.95, item3=6.95, item4=12.95,
item5=3.95; //storing 5 items.
double subtotal, tax, total;
//printing the item prices.
cout << "Price of item 1 = $" << item1 <<
endl;
cout << "Price of item 2 = $" << item2 <<
endl;
cout << "Price of item 3 = $" << item3 <<
endl;
cout << "Price of item 4 = $" << item4 <<
endl;
cout << "Price of item 5 = $" << item5 <<
endl;
subtotal = item1+item2+item3+item4+item5; //calculating total
without tax of 5 items.
cout << "\nSubtotal of the sale = $" << subtotal
<< endl; //printing subtotal
tax = (subtotal*7)/100; //calculating 7% tax.
cout << "\nThe amount of sales tax = $" << tax <<
endl; //printing tax.
total = subtotal+tax; //calculating total.
cout << "\nThe total amount = $" << total <<
endl; //printing the total of 5 items.
return 0;
}
output:
Note: my friend if you have any questions or queries comment below. Thank you my friend.
Get Answers For Free
Most questions answered within 1 hours.