Hello Brandon17,
As saeidsj has pointed out your setter functions are backwards.
Look at what you have:
1 2 3 4
|
void setValue (int theValue)
{
theValue = value;
}
|
What this is doing is setting "theValue" equal to "value" which has no value at this point.
Think about the logic here and the way this works. "theValue" receives what was sent to the function with the intention of changing the private variable of the class variable. In the case of assignment (=) this is done right to left. Be careful in the future because this is not the only thing that works right to left.
Now for the function "getCompute()" the for loop is all wrong. What I showed you earlier is more of a concept not the answer.
Try going to the top of the page and in the search box enter "factorial" after the first links that will take you off site look at the forth link, next to last post at the bottom of the post the function will give you a good idea of what to do for your function.
One last point. consider what is the largest number an "int" or "unsigned int" can hold? I am not sure at what number the factorial will produce a number larger than an "int" is, but I know that 20 do not work. It is worth your time to figure what each type of variable can hold. I even wrote a program once to display this information so I would not have to look it up every time.
Hint: look st what an "unsigned long long" can hold.
Hope that helps,
Andy