This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help with homework please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with homework please" Watch "Help with homework please" New topic
Author

Help with homework please

Mike Faulk
Greenhorn

Joined: Oct 22, 2011
Posts: 1
Hello, I am new to this forum, and new to Java as well. I just started my second Java class and I am having some problems with this program. It's a phone number dissector. So far all that I can get to print are the full number and the country code. I don't see why the other values are not getting passed. Can someone loko at this and help me out please?




here is the required driver



I know there are many ways to do this, however the assignment requires I use indexOf and substring methods as well as parseInt. Any help would be greatly appreciated.

Mike
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11139
    
  16

The best tool you have is the "System.out.println()". When I write code, I put them all over the place:

System.out.println("Got to point A");
System.out.println("Got to point B");
System.out.println("Variable x is now " + x);

put them in the beginning and ends of methods. print out what you pass into and out of each method.

Use them to see what your code is really doing. Once you know, you can comment them out as they are no longer needed.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with homework please
 
Similar Threads
Registering Custom property Editiors
When servlet compiles it can't find bean
Compare two text
sorting backwards with Arrays.sort()
Enumerating Letters (a=1,b=2..)