#include <iostream>
#include <iomanip>
using namespace std;
int main(){
    int iItemNum=0;
    double dItemCost=0, dTax=0, dTotal=0, dGT=0;

    cout <<"How many items do you have? ";
    cin >> iItemNum;
    
    cout << "\nHow much does each item cost? ";
    cin >> dItemCost;
    
    //    5% on any item below $500.00 /  and 6% on any item above $500.00
    
    if (dItemCost < 500){
        dTotal= iItemNum * dItemCost;
        dTax = dTotal * .05;
    }
    else{
        dTotal= iItemNum * dItemCost;
        dTax = dTotal * .06;        
    }
    
    dGT = dTotal + dTax;
    cout <<setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(2);
    cout << "\nThe subtotal of the items is: " << dTotal << "\nThe tax on these items is: " << dTax << "\nSo the grand total of your order is: " <<dGT;
    
    return 0;
}
