Quote:
Originally Posted by reuben2011
It should look something like:
sumOfNumbers(userNumber) (Your function name and parameter)
{ if userNumber == 1
{return 1 }
else
{return userNumber + sumOfNumbers(userNumber - 1) } }
Let us know if you need help understanding the above code or if you need help putting it in "Alice terms"
|
Hi, thanks for the reply! I was just wondering, I got the code for the function + parameter. But how do I get the user to input a number so that this code will work according to the number they input?