This week's book giveaway is in the Java in General forum.We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!

# Anyone know the aim of Sum?

Amy Phillips
Ranch Hand
Posts: 280
I have been working ahead again (just trying to avoid working on 4b really) but anyway I have hit Sum and it seems straight forward enough but I am a bit confused about what the aim is. I have read the previous posts on this but still have a few questions:
1. should it equal 100 or not?
2. do we have to explain what is happening when we submit this or is it just enough to know?

Thanks

John Hembree
hired gun
Ranch Hand
Posts: 250
Originally posted by Amy Phillips:
1. should it equal 100 or not?
2. do we have to explain what is happening when we submit this or is it just enough to know?

For (1.), I believe that's exactly the point of the exercise, to find out if it equals 100 or not.
For (2.), It couldn't hurt.

Chicken Farmer ()
Ranch Hand
Posts: 1932
I've never passed a student on this assignment, nor did I pass this assignment, until a least a reasonable attempt is made to describe why you get what you get.

Carol Murphy
village idiot
Bartender
Posts: 1202
I have a vague recollection of this assignment. On the surface it seemed easy, but there was an important lesson about the limitations of certain types due to the mysterious way computers do math. Trust your instincts on this one!

juliane gross
Ranch Hand
Posts: 161
I remember that the programming part was easy enough, but explaining was a bit tricky. I even discussed this with a mathematician friend and read in a couple of books about those phenomenons. I think the aim is to be occupied with this question long enough that you will probably remember that for a long time

Amy Phillips
Ranch Hand
Posts: 280
Hmm sounds more tricky than it first seemed - couldn't believe that it could be 7 and so easy so had to ask.
Anyway I take it from this then that you don't have to do some complex maths to the answer? I mean it could be 100 if I tried hard enough...
I am going to start looking around for some stuff about Doubles and hopefully by the time I pass 4b I should be an expert