Question #48805

Create an algorithm for a program that asks the user for the price of an item. The program then must display the given price, calculate and display the tax based on a 6% rate, and then calculate and display the grand total (total + tax).

Expert's answer

#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
using namespace std;
int main()
{
float price;
float tax;
cout<<"Enter the price : ";
cin>>price;
tax = price * 0.06;
system("cls");
cout<<"Price : "<<price<<endl;
cout<<"Tax : "<<tax<<endl;
cout<<"Grand total : "<<price + tax<<endl;
system("pause");
return 0;
}
LATEST TUTORIALS
APPROVED BY CLIENTS