I just need some help pulling the data from my loop. So lets say there was 10 transactions from my program before it was ended, I then need to total # units, average, total costs... etc. but I can't seem to pull out the correct data (except for total # of transactions). Thank you for any/all help.
You're not updating variables like totalU and totalR in the loop.
And most of your couts at the end are not printing any variable at all.
Here's an example of the kind of thing you should do:
Thank you for the response. The assignment I have requires the user to enter -99 0 to end the program. The last question I have is, how to not add the last transaction to the totals? This setup counts the final transaction
why would you not want to add the last transaction -- isn't that something the user enters legitimately? User either enters a transaction, or enters "0" or so, in which case the loop dies without anything getting incremented, so I'm not seeing your issue.
One last issue. Thank you all for replying, I have taken the information and rewrote some of the code and I have everything solved except for getting the smallest transaction. I can't seem to figure out what is wrong, the largest is working but smallest is not.
I'm not near my computer to do the testing for this but if I place u*p into a variable, would that work for large/small? It still seems odd that large totaling out just fine but small is not.