• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with homework please

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic