How to add Name: before name and $ before numbers in a .txt file in c++
<p>I'm having trouble figuring out how to do this:</p>

<p>I have to read from a .txt file that contains a name on one line, then a price on the next line, and continues about 10 times. (i.e. the text file says: </p>

<p>John Doe</p>

<p>234.0</p>

<p>Jane Doe</p>

<p>465.0</p>

<p>I have to print out "Name " in front of the name and "wage: " in front of the number. How would I do this? I don't even know where to start!</p>

<p>EDIT: What I have so far:</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;iomanip&gt;
#include&lt;fstream&gt;
#include&lt;string&gt;
using namespace std;

int main()

{
ifstream infile("wage.txt");
ofstream outfile("wage.txt");
string line;
if(infile.is_open){
    while(!infile){
        getline(infile,line);
        if (isdigit(line)){
            cout&lt;&lt;"$"&lt;&lt;line&lt;&lt;endl;
    }
}
}
return 0;
}
</code></pre>
