Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Problems with Input Strings

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    5
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Problems with Input Strings

    Im mimicking a bank type program as a side project. I dont know exaclty how to have someone type in a money value such as 300.02 and have it read it and work with it. Everytime I do it just quits the program.

    Heres the code

    Java pastebin - collaborative debugging tool

    Line 65 where its asking for input is where the problem is.

  2. The Following User Says Thank You to Bekuraryou1228 For This Useful Post:

    javapenguin (June 4th, 2010)


  3. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Problems with Input Strings

    Please post your code here using [code] tags

    [code]code goes in here[/code]

    looks like:

    code goes in here

  4. #3
    Junior Member
    Join Date
    May 2010
    Posts
    5
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Problems with Input Strings

    Code was too long, didn't wanna be annoying or inconvienence to anything. Thanks for the help!

  5. #4
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Problems with Input Strings

    Hello Bekuraryou1228,

    I have downloaded and compiled the code from the above link and it all works fine..

    I'm not sure why you are getting an error?!? I ran through it completely and it never quits unexpectedly.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  6. #5
    Junior Member
    Join Date
    May 2010
    Posts
    5
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Problems with Input Strings

    When I input a number in decimal format such as 300.00 when it asks how much to withdrawl, it just quits.

  7. #6
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Problems with Input Strings

    Quote Originally Posted by Bekuraryou1228 View Post
    Im mimicking a bank type program as a side project. I dont know exaclty how to have someone type in a money value such as 300.02 and have it read it and work with it. Everytime I do it just quits the program.

    Heres the code

    Java pastebin - collaborative debugging tool

    Line 65 where its asking for input is where the problem is.
    It seems the user won't know what the valid pin format is. Perhaps you could specify.

Similar Threads

  1. Problems with input data
    By Kakashi in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: April 22nd, 2010, 09:24 AM
  2. [SOLVED] allow a new input, dicarding the last mismatch input without terminating the program
    By voltaire in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 9th, 2010, 04:44 AM
  3. Problems with File Reader (Strings and 2D Array Storage)
    By K0209 in forum File I/O & Other I/O Streams
    Replies: 44
    Last Post: January 12th, 2010, 10:48 AM
  4. Strings
    By Leeds_Champion in forum Algorithms & Recursion
    Replies: 3
    Last Post: November 3rd, 2009, 10:09 PM
  5. Strings
    By BeSwift21 in forum Java Theory & Questions
    Replies: 1
    Last Post: October 13th, 2009, 07:02 PM