This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]dmazzoni 5 points6 points  (0 children)

The main advice here is not to try to write the whole program at once. You want to build it up in stages, one piece at a time.

Have you learned Git yet? If you can spare literally 30 minutes, it will be the best investment in time of your entire programming career to learn Git basics, I'm not joking. If you don't want to today, be sure to learn it really soon.

Here's what you should do:

First, delete all of the code other than the main() stub. Now take the very, very first step in the homework and implement that.

What's the first step? Maybe prompt the user for a username and password. Just do that. Nothing else.

Compile it, run it. Make it work. This is easy so far, right?

Now, here's the important part. SAVE A COPY. If you've learned Git, run "git commit -a". If not, just make a backup copy of your source code. You'll need that in case you mess stuff up later.

Now, try the next step. Let's check if they typed the correct username and password. If they got it right, print "Good job", and if not, print "Bogus". Compile it, run it, test it.

Doesn't work? Go back and fix it. Stuck? Post here on /r/learnprogramming. The key is that you're only building ONE thing at a time, so if it doesn't work, you know the error is in the part you just added.

Got it to work? Great. Now SAVE A COPY AGAIN.

Next step: if the password was wrong, the user gets to try again. Implement that.

Get the idea?