//Andres Guzman CSC5 Chapter 2, P. 81, #4
//
/**************************************************************
*
* COMPUTE TOTAL COST OF RESTAURANT BILL
* ____________________________________________________________
* This program computes the total bill after taxes & tips
*
* Computation is based on the formulas:
* tax_meal = (meal_check * tax) + meal_check
* total_meal = (tax_meal * tip) + meal_check
* ____________________________________________________________
* INPUT
* meal_check : total cost of meal
* tax : tax amount
* tip : tip amount
* OUTPUT
* total_meal : bill after taxes and tips
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double meal_check; //Input meal price
double tax; //Input tax amount
double tip; //Input tip amount
double tax_meal; //Output meal after taxes
double total_meal; //Output taxxed meal after tips
//
//Initializing Variables
meal_check = 44.50;
tax = 0.0675;
tip = 0.15;
//
//Computing total functions
tax_meal = (meal_check * tax) + meal_check;
total_meal = (tax_meal * tip) + tax_meal;
//
//Output Result
cout << fixed << setprecision(2) << "Meal Cost: $" << meal_check << endl;
cout << "Tax Amount: " << tax * 100 << "%" << endl;
cout << fixed << setprecision(0) << "Tip Amount: " << tip * 100 << "%" <<
endl;
cout << fixed << setprecision(2) << "Total Cost: $" << total_meal << endl;
return 0;
}