Hi,
> How to make the (profit) output to round to two decimal places
You simply need to set the output precision for std::cout before you output (profit)
And the results I got are:
Enter the Details of the books:
Enter book number: 0755798652
Enter price per copy: 34.98
Enter expected class enrollment: 35
Enter 'R' if required or 'S' is suggested: r
Enter 'N' if required or 'O' is suggested: O
The estimation for the next quarter is:
ISBN: 0755798652
Copies: 23
Profit: $1.6e+002
Press any key to continue . . .
it doesn't seem to work.
but when I tried the second suggestion:
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
It worked!!
But I would like to know why the first suggestion didn't work so I could know the different ways to achieve the same results.