aspose file tools*
The moose likes Beginning Java and the fly likes help with noob java program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help with noob java program" Watch "help with noob java program" New topic
Author

help with noob java program

lucas hall
Greenhorn

Joined: Jan 30, 2012
Posts: 1
greetings every one I am very new to the programming life and have been trying to learn on my own. I am having some problems with the output of this very simple program any ideas on where I went wrong. Please don't judge to harsh ahhahahh trying to learn as I go. Thank you




Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

I am having some problems with the output of this very simple program any ideas on where I went wrong.


You forgot to mention, your expected output.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Runrioter Wung
Greenhorn

Joined: Sep 03, 2011
Posts: 27

I correct the line 21 and line 41,you can compile it and run it.Look at the output.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
Runrioter Wung wrote: . . . I correct the line 21 and line 41,you can compile it and run it.Look at the output.
You haven’t corrected anything. You haven’t even found the errors.
[edit]YOu have changed 4 to 100, but that doesn’t seem to make any difference. Even it I put in numbers which I think will get acceptance, it won’t accept me. I copied and pasted what you posted.[/edit]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
Welcome to the Ranch

You really need to find out about code conventions, and spread out your code. You can find out about code conventions here, though that is an old document, and I prefer the different identation conventions here. By indenting code, you make it much easier to read, and you also make it easier to find mistakes because of unbalanced {}. As it is, you have several lines squashed into one, which makes your code really difficult to read.
Also you will find you ought to avoid if (...) return true; else return false;
You ought to avoid numbers in your code. If you need to use 100, you should give it a name as a constant, like this public static final int BOILING_WATER = 100; That makes it obvious what the 100 means. I can’t tell what 100 means by reading the code. I can’t tell what values are supposed to be accepted and what rejected.

Why are you making everything static? Is it because you have a book which teaches you to put everything into the main method?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help with noob java program
 
Similar Threads
Please Help!
How would i break this down into seperate metods?
two puzzling errors
Converting Infix to Postfix Expressions
reading input from a file into a array