Thursday, September 4, 2014

Homework 1.6 Feedback

Great job on this homework assignment! Here are some trends across the class that I wanted to point out:

  • When debugging code make sure the following things are matched correctly:
    • curly brackets {}
    • parentheses ()
    • double quotes "" 
  • Glad to see escaped sequences used properly! But using many \n in one println() statement results in super long lines of code. They can be difficult to read as a programmer because you have to scroll right and left to see the whole line of code. Use multiple println() statements to improve code readability. 
  • Question 4 asked to find four errors. Three of those errors are "compilation" errors. Meaning that when you try to run the program, you should see three errors in the Error window.
    The fourth error is a "functional" error. After you fix the first three errors, the program will run in Eclipse, but it won't print what was expected: a modified version of the first line of the Gettysburg Address by Abraham Lincoln. The block comment, /* */, cut out all men, but didn't replace it with anything. It should print:
Four score and seven years ago, 
our fathers brought forth on
this continent a new nation
conceived in liberty, 
and dedicated to the proposition
that
all 
PEOPLE 
are
created
equal. 

What do you need to change to print this?

No comments:

Post a Comment