SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
SCJP, SCWCD
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:Why don't you test your code yourself? Wouldn't that be faster than asking strangers to do it?
I'd also suggest you try writing less at a time before testing. I often write as little as 1 or two lines before I re-compile, test, fix, etc.
Dmitri Makovetskiy wrote:alright , i edited my whole code, i think it is okay,, check it above (i edited it)
i tested it
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
"If the facts don't fit the theory, get new facts" --Albert Einstein
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:
Dmitri Makovetskiy wrote:alright , i edited my whole code, i think it is okay,, check it above (i edited it)
i tested it
If you tested it, then you should know if it's right or not. If you are aware of some specific problem, tell us.
The purpose of this site is not to provide free code, testing, or homework checks. We are thrilled to help you learn, and people will bend over backwards to help you if you have a question about something.
I doubt that many folks are going to provide you with free testing services.
fred rosenberger wrote:well then...i would say it's not right.
SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
"If the facts don't fit the theory, get new facts" --Albert Einstein
Hunter McMillen wrote:Well this is a function you can test by hand yes? So if your result by hand doesn't match the result of your program, there is a mistake.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:
Hunter McMillen wrote:Well this is a function you can test by hand yes? So if your result by hand doesn't match the result of your program, there is a mistake.
Agreed.
Dmitri, what you're basically saying is that you are too lazy to check it yourself, and you want someone here to do it for you.
If, instead, you wrote a post saying "I used values 3, 4 and 5 for my inputs, and was expecting 54 but got -3622014.05", then people would see you trying and want to help you.
instead, many people see you doing as little as possible and asking people to do the work you should do. They're getting tired of it, and many will not bother with you anymore.
Please, for your own sake, ShowSomeEffort.
"If the facts don't fit the theory, get new facts" --Albert Einstein
Hunter McMillen wrote:rewriting wasn't the issue you were experiencing, testing was.
Henry Wong wrote:
Hunter McMillen wrote:rewriting wasn't the issue you were experiencing, testing was.
Agreed. If you can't test it, you don't know why it's wrong. And if you don't know why it's wrong, then the "rewriting" are just non-targeted changes.
Henry
Regards, Rene Larsen
Rene Larsen wrote:If you post the 3 numbers used - and then the result, then we can see if you have done the calculation correct
![]()
BTW. if you are using the above code - then the factorial operation methods g and i are not correct (but almost).
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:is that what YOU calculated for the answer, or what you code gave you?
Why does the fact that your answer 'is sometimes negative' bother you? (7+a)! is going to be a rather large number if a is anything greater than 1. The only other term.
a*2^a might get large, but factorial grows faster (I think).
Dmitri Makovetskiy wrote:okay the code is correct, my teacher confirmed it.. thank you for your unhelpful assistence everyone