Respuesta :

Initialize it's variable:

double total = 0.0
while( whatever )