Thread
:
User Input help
View Single Post
11-28-2012, 11:20 AM
PM User
|
#
2
niralsoni
Regular Coder
Join Date: Mar 2008
Location: London
Posts: 129
Thanks: 1
Thanked 31 Times in 31 Posts
First, initialise your variable to zero
Code:
double runningtot = 0.00;
Then, in the for loop, keep on adding the amount rather then updating it.
Code:
runningtot
+=
price;
Hope this helps you out...
Regards,
Niral Soni
niralsoni
View Public Profile
Find More Posts by niralsoni