//Andres Guzman CSC5 Chapter 2, P. 82, #8
//
/**************************************************************
*
* COMPUTE TOTAL SALE OF 5 ITEMS
* ____________________________________________________________
* This program computes the total price of items after taxes
*
* Computation is based on the formulas:
* subtotal = item1 + item2 + item3 + item4 + item5
* total = (subtotal * tax) + subtotal
* ____________________________________________________________
* INPUT
* item1 -> item5 : Price of item
* tax : Tax after subtotal of items
* OUTPUT
* subtotal : Sum of all items
* total : Sum including tax
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
double item1; //Input Price
double item2; //Input Price
double item3; //Input Price
double item4; //Input Price
double item5; //Input Price
double tax; //Input Tax Precentage
double subtotal; //Output Sum of all Items
double total; //Output Total sum with Tax
//
//Initializing Variables
item1 = 12.95;
item2 = 24.95;
item3 = 6.95;
item4 = 14.95;
item5 = 3.95;
tax = 0.06;
//
//Computing Formulas
subtotal = item1 + item2 + item3 + item4 + item5;
total = (subtotal * tax) + subtotal;
//
//Output Results
cout << "Item 1: $" << item1 << endl;
cout << "Item 2: $" << item2 << endl;
cout << "Item 3: $" << item3 << endl;
cout << "Item 4: $" << item4 << endl;
cout << "Item 5: $" << item5 << endl;
cout << fixed << setprecision(2) << "Subtotal: $" << subtotal << endl;
cout << fixed << setprecision(0) << "Sale Tax: " << tax*100 << "%" << endl;
cout << fixed << setprecision(2) << "Total: $" << total << endl;
}