in reply to confused with summing certain elements from an array

Since this is a school assignment, the person you should be talking to, first and foremost, is your instructor. But in addition, give yourself time to reason the problem out.

One thing that I suggest to my students is:   your best friend just might be a diary or a loose-leaf notebook, and a number-two pencil. Write down, in your own words:

Some parts of the project may suggest-themselves, starting to appear dimly in the gloom of your as-yet disorganized thoughts. For instance, you know that this program is going to involve “a loop,” and it's going to involve “counting,” and perhaps although you don't yet see how the whole thing will fit together, you can consider how you might approach one part. So, force your mind to push-away the fact that you don't yet have the entire picture, and focus instead on whatever smaller-piece now appears to be coming out of the fog. That's what the pencil-and-paper is for. I assure you that your subconscious mind is working on this problem now. Vigorous exercise -- swimming, tennis -- also helps.

Don't just run to the Internet for someone to tell you the answer. You're here, not just to “get” the answer, but to “learn how to get” the answer. Don't cheat yourself. And, be patient. The first program I ever wrote was eight lines long, took me three months to write, and had a bug in it.

Replies are listed 'Best First'.
Re^2: confused with summing certain elements from an array
by amarquis (Curate) on Nov 20, 2007 at 19:44 UTC

    Where were you years ago when I started taking CS classes? The first two years was all trees and no forest, so I ditched the major and jumped onto the Physics bandwagon. I would have been happier in the department if more professors had integrated your "stop and think about what the heck you are doing" philosophy.

    To the original poster: sundial is right. It isn't bad or even uncommon that you are having a "Where do I even start" problem, but you won't fix it by taking the answer straight from here. Go find help, from your instructor, from teaching assistants, from classmates, or whoever is around. You'd be doing yourself a favor to tackle this problem right away, rather than letting it compound during the semester/school year.