Respuesta :

The while loop runs while userVal is greater than or equal to 0. Then, the user is asked to enter a positive integer to continue the while loop or enter a negative integer to break out of the while loop. An if statement checks to see if userVal is greater than or equal to 0 and if that's the case, a function named "sumOfDigits" is called, the parameter being userVal. From the name of the function, we can assume it gets the sum of all the digits of a number. The return value of the funciton is added to a variable called sd. Then userVal is checked to see if it is divisible by 5 or three and if this is true, userVal is added to a variable called sumDiv. userVal is checked to see if its prime and if this is the case, 1 is added to the variable cntPrime and the userVal is added to a variable called sumPrime. The while loop will continue asking the user for numbers until the user enters a negative number.