Aligning decimal points

I have a assignment, and im not asking for anyone to do it for me. But it is a simple beginers class and i have to make a simple tip calculator the problem i am having is aligning the decimal points on the out put here is part of the code
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
double tip;
double tax;
double total;
double bill;

cout << "\n Enter price of bill: $";
cin >> bill;
tip=bill*.15;
cout << "*********************";
cout <<"\n*Tip amount: $" << tip << "*";
tax=bill*0.10;
cout <<"\n*Tax amount: $" << tax<< "*";
total=bill+tip+tax;
cout <<"\n*Total due:$" << total <<" *";
cout <<"\n*********************";



return 0;
}
any help is appreciated
Look into the setw() function: http://www.cplusplus.com/reference/iostream/manipulators/setw/

Also, since we're talking about money you technically only need 2 decimal points, so you'll also want to use the setprecision() function:
http://www.cplusplus.com/reference/iostream/manipulators/setprecision/
Topic archived. No new replies allowed.