Review: Restaurant Bill

Hello I am currently learning C++ programming on my own and am doing these programming questions in this textbook that I have and am asking if you could look over what I have done to see if it is correct.. This is is program I have wriiten with the question at the top as a comment



//Write a program that computes the tax and tip on a restaurant bill for a patron with a
//$44.50 meal charge. The tax should be 6.75 percent of the meal cost. The tip 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
#include <iostream>
using namespace std;

int main()
{
double meal_cost = 44.50,
tax = 0.0675,
tip = .15;
int Tax_MC,
bill,
total_bill,
Tip_TB;

//Calculate the tax of the meal cost
Tax_MC = meal_cost * tax;

//Calculate the amount of the bill
bill = Tax_MC + meal_cost;

//Calculate the cost of the tip from bill
Tip_TB = bill * tip;

//Calculate the total amount of the bill plus tip
total_bill = bill + Tip_TB;

//Display the results
cout << "The meal cost came up to $" << meal_cost <<" without tax" << endl;
cout << "The tax amount of the meal cost is $" << Tax_MC << endl;
cout << "The tip came up to $" << Tip_TB << endl;
cout << "The amount of the bill plus tip is $" << total_bill << endl;
system("pause");
return 0;
}
Why don't u test ur program urself ^^ Anyways its good just in real applications you wouldn't use system functions. Also use code tags for code :p.
ohh ok I did test it, but i just wanted to know if it was how i was supposed to do it. Thanks.
Topic archived. No new replies allowed.