Keeping track of number of users my program interacted with?
<p>My garbage collection program is running fine, however I have to keep track of how many users my program interacted with, how do I get it to remember how many users it has talked to, also would a while loop be more useful than for loops?</p>

<pre><code>// Garbage Collection. 
#include &lt;iostream&gt;
#include &lt;cmath&gt;

using namespace std;

int main(){
double reg, glass, met;
double total;
double reg_ratio, glass_ratio, met_ratio;

cout &lt;&lt; "How much regular, glass, and metal garbage do you have?" &lt;&lt; endl;
cin&gt;&gt; reg;
cin&gt;&gt; glass;
cin&gt;&gt; met;

total= met+glass+reg;

cout&lt;&lt; "The total number of bags is "&lt;&lt; total&lt;&lt; endl;

met_ratio= met/total;
reg_ratio= reg/total;
glass_ratio= glass/total;

cout&lt;&lt; "The metal ratio is "&lt;&lt; met_ratio&lt;&lt; endl;
cout&lt;&lt; "The glass ratio is "&lt;&lt; glass_ratio&lt;&lt; endl;
cout&lt;&lt; "The regular ratio is "&lt;&lt; reg_ratio&lt;&lt; endl;
if( met==reg==glass)
{
cout&lt;&lt; "All garbage amounts are the same."&lt;&lt; endl;
}
else if (reg&gt; glass &amp;&amp; met)
{
cout&lt;&lt; "Regular is the largest."&lt;&lt; endl;
}
else if (glass&gt; met &amp;&amp; reg)
{
cout&lt;&lt; "Glass is the largest."&lt;&lt; endl;
}
else if (met&gt; glass &amp;&amp; reg)
{
cout&lt;&lt; "Metal is the largest."&lt;&lt; endl;
}


for(; reg &lt;= 50; reg += reg){
cout &lt;&lt;"I can only accept " &lt;&lt; 50- reg &lt;&lt;  " of your " &lt;&lt;reg &lt;&lt;" bags of garbage. I'll      leave the other behind."&lt;&lt; endl;
}
for(; met &lt;= 20; met += met){
cout &lt;&lt;"I can only accept " &lt;&lt;  20 - met &lt;&lt; " of your "&lt;&lt; met&lt;&lt;" metal bags of garbage.    I'll leave the other  behind."&lt;&lt; endl;
}
for(; glass &lt;= 20; glass += glass){
cout &lt;&lt;"I can only accept " &lt;&lt;  20 - glass &lt;&lt; " of your "&lt;&lt;glass&lt;&lt;" bags of garbage. I'll leave the other behind."&lt;&lt; endl;
}
</code></pre>

<p>return 0;
}</p>
