When I testBed my code, it will not put any decimals on my numbers. However, all but one number get decimals in my second test.
I am not sure if it is just that float only puts decimals when the user needs them, or if I am missing something in my code. Do I need to specify how many decimals to include, and if so, how would I change that?
Thanks ahead of time for any help.
int main()
{
float income;
cout << "\tYour monthly income: ";
cin >> income;
cout << "\tItem Budget Actual\n";
cout << "\t=============== =============== ===============\n";
cout << "\tIncome" << setw(11) << right << "$" << setw(11) << right << income;
cout << setw(5) << right << "$" << setw(11) << right << income <<"\n";
}
This is the error I am getting
> Your monthly income: 1
> \tIncome $ 1 $ 1\n
Expected: \tIncome $ 1.00 $ 1.00\n