PoovenM 30 Junior Poster

Oh I didn't mean that your post wasn't called for ~s.o.s~, I certainly respect a featured poster such as yourself. I actually skimmed the original post and didn't notice he mentioned JavaScript hehe. It was your reply that made me realize that it was JavaScript related.

I was just confused about why the post was here.

~s.o.s~ commented: Heh, no problemo. :-) +26
PoovenM 30 Junior Poster

Aww I can see that you need sleep hehe you'd need a looping structure to read the entire file! I guess I could have given you a better hint!

The basic idea is that you'd read from the file while the input is not null. What you'd do is use a loop that looked something like this:

String s = inFile.readLine(); //the loop should start after this line
while (s !=null)
{
...
s = inFile.readLine(); //here you change the value of s for checking
}

Where ... refers to the code after the line String s = inFile.readLine();

If you wanted to be a bit more fancy you could have just had:

while(s=readLine() != null)
{
...//notice that s is not updated in the body of the loop
}

If you need help understanding this, please let me know. The basic idea of a loop is to initialize, check the test variable/condition and finally to change the test variable/condition within the loop body. Using this, you'd never go wrong!

PoovenM 30 Junior Poster

Indeed the problem at hand it rather complex and evolutionary programming has given results much better than previously employed mathematical models. There input set space has too many dimensions making the mathematical solution too complex. The nice thing about the Evolutionary Algorithm is that the bet fit test helps prune out bad results and in a way acts as a constraint to the system.

I'm from the University of KwaZulu-Natal in South Africa. One of the Doctors in our School, Dr Nelisha Pillay, has done allot of research in this field. She suggested the following link to me: http://www.asap.cs.nott.ac.uk/watt/resources/university.html

Her home page is: http://www.titan.cs.unp.ac.za/~nelishiap/

Hope this helps you on your way... and all of the best in your research!

PoovenM 30 Junior Poster

I think I might have made the same mistake. The way Scanner works, is by matching patterns in some stream. When you use nextInt() it will attempt to find an integer value in the input stream. If it is successful, it will move forward in the stream. If it is not successful then it will not move forward. Thus when you input words, you remain on the same input until you call the appropriate Scanner method to match it and proceed.

So add scan.nextLine(); after the line with your message: System.out.println("You must enter an integer. Try again.\n"); So you'd have:

catch (InputMismatchException inputMismatchException)
{                                                                
    System.out.println("You must enter an integer. Try again.\n");    
    scan.nextLine();
}

This will allow the scanner object to skip the error and move forward in the input stream. By the way, perhaps if would be best to check if n2 is zero before actually doing the division :icon_wink: it works regardless, but it's still an unneeded calculation if there is an error.

darklich13 commented: Excellent post!!! Thanks for the help +1
PoovenM 30 Junior Poster

Well the first step is to identify that indeed Apache Tomcat is up and running. If you go to localhost:8080 it should display a Tomcat page. If that doesn't work then the Tomcat service is not running. It can usually be started using the /bin/startup.bat or /bin/startup.sh file. What OS are you running?

Tomcat will by default assume that the Java bin folder is specified via the JAVA_HOME environment variable. This can be set depending on your OS.

If I'm not mistaken Tomcat requires JavaEE (Enterprize Edition) which makes sense but I can't confirm that.

Perhaps try out the Web Development> JSP forum?

majestic0110 commented: Helpful advice, solver of problems! +1
PoovenM 30 Junior Poster

I agree with Masijade, one would tend to not create an 'exe' file from a Java program. Indeed there should exist a byte code to exe compiler, though I wonder how efficient/valid one would be; Java is a growing language and some of the specifications of Java aren't easily portable to C++ (which is what a 'class' to 'exe' compiler would likely attempt to do).

What usually happens is that we create a 'jar' file. This file is recognized by Java and executes much like an 'exe' file; the only catch is that you must have Java installed, which of course you do. The easiest way is to make a 'jar' file is to use NetBeans :D

PoovenM 30 Junior Poster

Hey, was just wondering... when you decrement currCD , how do you ensure that it isn't a negative number? Perhaps it is handled internally... but if it isn’t then wouldn’t that be an issue? Yeah was just wondering...

no1zson commented: Thanks for the tip. +1
PoovenM 30 Junior Poster

It's perfectly acceptable to have an inner class. You'll be able to access all the methods and instance variables of the inner class in your outer class. Now I'm not too sure about the reverse. I think that you'll be able to access all instance methods of the outer class in the inner class if they are declared above the inner class... now I also remember that things like that aren't an issue in Java so perhaps I'm mistaken.
I didn't quite understand points 2 and 3 I'm afraid.
Yes you can install Java on Linux... there are various ways to do it. Most Linux flavors come with Java support. Federa actually has Eclipse in it though I'm still a strong fan of Suse Linux :D
Well hope that helps.. I'll try the inner and outer class things and post a more certain reply if you don't get another.
Peace :)

ajay_tabbu commented: this post really help me. +1