Answer to Question #19895 in C++ for ainafatin akifeen

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.
1
Expert's answer
2012-12-05T09:58:16-0500
#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");

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS