reading multiple input from the user

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stmfc
    New Member
    • May 2007
    • 65

    reading multiple input from the user

    i want to get some values from the user and process them.
    e.g)
    enter three numbers: 1 10.5 50
    result is 61.5

    is it possible to get these three double values from the user without
    using string tokenizer?
    (and also without processing the string char by char)

    can i get these inputs from the user using readDouble or something?
    i am looking for a way like scanf of c programming.
    (e.g scanf("%f%f%f", &val1,&val2,&va l3); )
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by stmfc
    i want to get some values from the user and process them.
    e.g)
    enter three numbers: 1 10.5 50
    result is 61.5

    is it possible to get these three double values from the user without
    using string tokenizer?
    (and also without processing the string char by char)

    can i get these inputs from the user using readDouble or something?
    i am looking for a way like scanf of c programming.
    (e.g scanf("%f%f%f", &val1,&val2,&va l3); )
    java.util.Scann er is your friend here. See the specs page for it.

    Comment

    • gaya3
      New Member
      • Aug 2007
      • 184

      #3
      Originally posted by stmfc
      i want to get some values from the user and process them.
      e.g)
      enter three numbers: 1 10.5 50
      result is 61.5

      is it possible to get these three double values from the user without
      using string tokenizer?
      (and also without processing the string char by char)

      can i get these inputs from the user using readDouble or something?
      i am looking for a way like scanf of c programming.
      (e.g scanf("%f%f%f", &val1,&val2,&va l3); )
      Hi,
      I think following code may help u....

      <Removed>
      Last edited by r035198x; Aug 27 '07, 06:50 AM. Reason: Spoon feeding is against site rules

      Comment

      Working...