Friday, October 14, 2011

So You Want to Be a Programmer(Java): Get Started NOW!

Open Eclipse and create a new Java project in the same manor that you created the Hello World project. Name the project Raven and create a new class named TheRaven. Be sure to check the box that says "public static void main(String[] args)".

Create a program that prints the following excerpt from Edgar Allen Poe's The Raven:

horizontal spaceOnce upon a midnight dreary, while I pondered weak and weary,
Over many a quaint and curious volume of forgotten lore,
While I nodded, nearly napping, suddenly there came a tapping,
As of some one gently rapping, rapping at my chamber door.
`'Tis some visitor,' I muttered, `tapping at my chamber door -
Only this, and nothing more.'

Ah, distinctly I remember it was in the bleak December,
And each separate dying ember wrought its ghost upon the floor.
Eagerly I wished the morrow; - vainly I had sought to borrow
From my books surcease of sorrow - sorrow for the lost Lenore -
For the rare and radiant maiden whom the angels named Lenore -
Nameless here for evermore.

Your output should appear exactly like this:



Necessary Information (Click on links for more info):
There are two ways to print in Java, System.out.println(); and System.out.print(). The only difference is that System.out.println(); prints a return at the end of what you are printing.
The sentence or words that you put in the quotes in the print statement is called a String.
To print a new line in Java you use, "\n".
To print an apostrophe, you use "\'".


It is possible that you may need help with this. Contact me with any questions you have!

2 comments:

  1. It'd be better if you included some code so that the reader can make sure that they're doing it right. And it would also be worth individually addressing all of the potential problems or confusions that they might run into.

    Also, if you haven't done so already, go back to your older posts in this series and make them link to each other, so that at the end of each article you have something like "click here for the next lesson".

    Now if you really want to get serious with this guide, make sure you get plenty of feedback from people who don't know anything about programming. For some people, programming just doesn't come naturally for them and they have a serious learning curve to go over. If you want to deliver a solid series of guides, it'd be worth your interest to spend some time with such people in order to figure out how they think and why thinking in code can be so hard for them. Maybe even become a section leader for 127A.

    ReplyDelete
  2. I actually have the code written. Just have been very busy and no time to post it. Im looking for a good way to format it for blogger. Great suggestions though, thank you.
    I'm not necessarily going to be writing all of the tutorials. I do have some plans to simply link to some of the good ones that I find. I am planning on guiding people through what I think is the most logical order of learning concepts. I mostly am doing this to help a couple of friends to learn programming, but decided if I am going to do it that I might as well make it publicly available. But all very good feedback and I have been thinking about trying to become a 127A section leader.

    ReplyDelete