I would make these values into constants:
1 2 3 4
|
const float pound = 1.478;
const float franc = 0.172;
const float deutschemark = 0.584;
const float yen = 0.00955;
|
Don't attempt to assign any other value, for example don't do this:
pound = dollar/pound;
Instead, define new variables for any subsequent calculations.
For a single calculation it would not matter very much, but if the user needed to enter a series of different dollar amounts, you'd want the original conversion rates to remain unaltered.
As well as that, you can't carry out the actual conversion until after line 32:
cin >> dollar;
That is, until the user has entered the value for dollar, it isn't possible to convert that amount into any other currency.
as for the original question, try
cout << fixed << setprecision(2);