• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Feedback.

 
Stephen Foy
Ranch Hand
Posts: 143
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just finished this program, just looking for some opinions, is there any way i can improve this? is the coding messy? could i add more comments?

 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well at least you didn't put that pointless for loop the other person doing this same homework did. He did have the same code when n = 1 or n = 2 and you do two different things.

if (n ==1) { line2 = line5; line3 = line4;} // When there is no bytes left, changes lines.
if (n ==2) { line3 = line4; line2 = line6;} // When there is no bytes left, changes lines.

I think he made line2=line5 on both cases, might want to check your code or tell him about his error.

Besides that you can put all those strings as constants public static final declares in the class.

Public Static Final LINE_1 = " bytes of bits on the bus ";... etc instead of
String line2 = (" bytes of bits \nTake two down, \nshort them to ground. ");...

You can do away with the parenthesis.

What if caps locks is set?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic