• Post Reply Bookmark Topic Watch Topic
  • New Topic

could someone can take a look at my code and leave feedback?

Mario Leo
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i also have another one_____________________

Campbell Ritchie
Posts: 53140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post; you should always use them as the make the code look better Unfortunately, they also highlight some formatting problems:-
  • 1: The use of tabs for indenting.
  • 2: Inconsistent indenting. Get a decent text editor, eg jEdit, kate, gedit, NotePad2, NotePad++ and set its “automatic indentation” option. Then lines 11 and 12 would look better. Or use the formatting options in your IDE.
  • 3: Inappropriate documentation comments, and //TODO empty method comments, presumably inserted by an IDE, not deleted.
  • 4: Multiple declarations on one line (eg 12), made even worse by being interspersed with initialisations.
  • 5: No {} after if on line 23.
  • 6: Some lines too long, and too many blank lines; both those things make the code harder to read.
  • 7: Some of the variables’ names do not make their meaning obvious, eg orate.
  • 8: No spaces around some binary operators, eg <
  • 9: Use of the newline character; you should use printf and %n instead.
  • And some design things.
  • 1: Far too much code in the main method.
  • 2: No sign of object‑oriented design anywhere.
  • 3: The meaning of the two loops is not obvious. The first while has a condition which includes redundant parts.
  • Does your code do what you want it to? I think it needs a lot of tidying up, I am afraid.
    Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
    the new thread boost feature: great for the advertiser and smooth for the coderanch user
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!