//Amari Mosley CSC5 Chapter 2, P. 81, #8
//
/**************************************************************
*
* TOTAL PURCHASE
* ____________________________________________________________
* This program calculates the subtotal of the sale, the amount
of sales tax, and the total.
* Computation is based on the following formulas:
* Subtotal = Item1 + Item2 +Item3 + Item4 + Item5
TotalTax = Subtotal * TaxRate
Total = Subtotal + TotalTax
* ____________________________________________________________
* INPUT
* Item1, Item2, Item3, Item4, Item5 : The five items the customer is buying
*
* TaxRate : The base tax rate percentage
* OUTPUT
* SubTotal : Sum of all 5 items
TotalTax : Total amount of tax being payed
Total : Total amount of money being paid (sum of SubTotal and TotalTax)
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
// Defining Main Function
int main()
{
// Defining double Variables
double Item1, Item2, Item3, Item4, Item5;
double TaxRate;
double SubTotal, TotalTax, Total;
// Assigning Values of Variables TotalSales and EastCoast
Item1 = 12.95, Item2 = 24.95, Item3 = 6.95, Item4 = 14.95, Item5 = 3.95;
TaxRate = 0.06;
//Computing SubTotal
SubTotal = Item1 + Item2 + Item3 + Item4 + Item5;
//Computing TotalTax
TotalTax = SubTotal * TaxRate;
//Compute Final Total
Total = SubTotal + TotalTax;
cout << "Price of item 1: $" << Item1 << endl;
cout << "Price of item 2: $" << Item2 << endl;
cout << "Price of item 3: $" << Item3 << endl;
cout << "Price of item 4: $" << Item4 << endl;
cout << "Price of item 5: $" << Item5 << endl;
cout << "Subtotal: $" << SubTotal << endl;
cout << "Sales tax: $" << TotalTax << endl;
cout << "Total: $" << Total << endl;
return 0;
}