File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with homework please

 
Mike Faulk
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 12022
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic