Question #19895

write a program that computes the tax and tip on a restaurant bill for a patron with $44.50 meal charge.the tax should be 6.75 percent of the meal cost.the tips should be 15 percent of the total after adding the tax.display the meal cost,tax amount,tip amount, and total bill on the screen.

Expert's answer

#include <math.h>
#include "iostream"
using namespace std;

int main()
{
float p = 44.50;
float a,b,s;
a= 0.0675*p;
b= 0.15*(a+p);
s=p+a+b;
cout<<"meal: "<<p<<endl;
cout<<"tax amount: "<<a<<endl;
cout<<"tip amount: "<<b<<endl;
cout<<"total bill: "<<s<<endl;
system ("PAUSE");

}

LATEST TUTORIALS
APPROVED BY CLIENTS