|The program at the end should ask: How much was the meal? 44.50. the it should calculate the tax (.065) , calculate the tip (.15 of meal + tax) and calculate the total cost. Here's my program:|
// This program asks the cost of the meal, calculates the tax, the tip and the total restaurant bill.
using namespace std;
double meal = 44.50; // meal
double tax = .0675*meal; // tax
double tip = .15*(meal+tax); // tip
double total = meal + tax + tip; // total
tax; //computed tax
tip; //computed tip
total; //computed total
// Get the cost of the meal.
cout << "How much was the meal? ";
cin >> meal;
// Get the tax.
cout << "What was the tax? ";
cin >> tax;
// Calculate the tax.
tax = meal*.0675 ;
// Get the tip.
cout << "What was the tip? ";
cin >> tip;
// Calculate the tip.
tip = (meal+tax)*.15 ;
// Get the total amount.
cout << "What was the total amount? ";
cin >> total;
// Calculate the total.
total = meal + tax + tip;
// Display the meal charge. << "The meal charge $" << meal <<;endl;
// Display the tax charge. <<"The tax charge $" << tax << endl;
// Display the tip charge. <<"The tip charge $" << tip << endl;
// Display the total. <<"The total amount spent $" << total << endl;
Where did I go wrong? JJH - FL