//Amari Mosley CSC5 Chapter 2, P. 81, #4
//
/**************************************************************
*
* RESTAURANT BILL CALCULATION
* ____________________________________________________________
* This program will compute the tax and tip on a restaurant bill for a patron with a
$44.50 meal charge.
* Calculation is based on the following formulas:
TaxAmount = MealCost * TaxRate // Finds just the tax amount
BillWithTax = MealCost + TaxAmount // Finds the bill with tax included
TipCompute = BillWithTax * TipRate // Finds just the tip amount
TotalBill = BillWithTax + TipCompute //Finds total bill with tax and tip included
* ____________________________________________________________
* INPUT
* MealCost : The original cost of the meal ($44.50)
* TaxRate : The state tax rate (6.75%)
* TipRate : The tip percentage (15%)
*
* OUTPUT
* TaxAmount : Calculated tax amount
* BillWithTax : Meal cost plus tax
* TipCompute : Calculated tip amount
* TotalBill : Final total including tax and tip
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
// Defining Main Function
int main()
{
// Defining Variable Values
double MealCost = 44.50;
double TaxRate = 0.0675;
double TipRate = 0.15;
double TaxAmount, BillWithTax, TipCompute, TotalBill;
// Computations Step by Step
TaxAmount = MealCost * TaxRate; // Finds just the tax amount
BillWithTax = MealCost + TaxAmount; // Finds the bill with tax included
TipCompute = BillWithTax * TipRate; // Finds just the tip amount
TotalBill = BillWithTax + TipCompute; // Finds total bill with tax and tip included
//Final Bill Display
cout << "Meal Cost: $" << MealCost << endl;
cout << "Tax Amount: $" << TaxAmount << endl;
cout << "Tip Amount: $" << TipCompute << endl;
cout << "Total Bill: $" << TotalBill << endl;
return 0;
}