#include #include using namespace std; int main() { const double rate = 0.06; double price = 0.37; // arbitarily set to show different formatting double tax; double total; cout << setw(10) << "Price" << setw(10) << "Tax" << setw(10) << "Total" << endl; for (int cnt = 0; cnt < 5; cnt++) { tax = price * rate; total = price + tax; cout << setw(10) << price << setw(10) << tax << setw(10) << total << endl; price = price * 11; // arbitrarily increase to show different formatting } cout << endl; price = 0.37; // arbitarily set to show different formatting cout << setw(10) << "Price" << setw(10) << "Tax" << setw(10) << "Total" << endl; for (int cnt2 = 0; cnt2 < 5; cnt2++) { tax = price * rate; total = price + tax; cout << fixed << setprecision(2) << setw(10) << price << setw(10) << tax << setw(10) << total << endl; price = price * 11; // arbitrarily increase to show different formatting } cout << endl; cout << left << setw(10) << "Price" << setw(10) << "Tax" << setw(10) << "Total" << endl; cout << right << setw(10) << "Price" << setw(10) << "Tax" << setw(10) << "Total" << endl; return 0; }