I have been spending a long time trying to figure out a way to correctly write this code. I am supposed to use sentinel loop to write this code. Here is what I have so far....
#include "cs150io.hxx"
#include <iostream>
#include <string>
using namespace std;
int run(istream& cin, ostream& cout)
{
// Magic Formula
cout.setf(ios::fixed);
cout.precision(2);
This is what it should look like when I enter 1, 2, 5, 6, 0...
Enter the current conversion rate from USD to yen: 78.66
Enter a list of US dollars ending in 0:
1 2 5 6 0
Result=[$1.00=78.66Y, $2.00=157.32Y, $5.00=393.30Y, $6.00=471.96Y]
when I enter 0...
Enter the current conversion rate from USD to yen: 78.66
Enter a list of US dollars ending in 0:
0
Result=[NONE]
This is what I have...
Enter the current conversion rate from USD to yen: 78.66
Enter the list of US dollars ending in 0:
1 2 5 6 0
Result=[$1.00=78.66Y]
Result=[$2.00=157.32Y]
Result=[$5.00=393.30Y]
Result=[$6.00=471.96Y]
and when I input zero...
Enter the current conversion rate from USD to yen: 78.66
Enter the list of US dollars ending in 0:
0