codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  I`m new and have a Problem  marshalthrone at 04:35 on Wednesday, September 30, 2009
 

I'm taking this as a class but i'm stuck

import java.util.*;

public class Sort3 {

public static Scanner in = new Scanner (System.in);

public static void main (String [] args) {

System.out.println (GetDouble());

double a = GetDouble();

double b = GetDouble();

double c = GetDouble();

}
public static double GetDouble() {

System.out.print ("Enter a double: ");

double x = GetDouble ();


return x;
}
}



When i run this it prints out "Enter a double:" hundreds of times and a dont know y. I need to be able to have GetDouble Ask 3 sperate times so i can get a,b, and c. ???
Also on a side note how would i check to make sure they entered a valid double??








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  VBA crawlers for JavScript Websites....
•  ASP.NET ValidationExpression - email validation
•  Re: Two dimentional array - Dropdown box
•  I`m new and have a Problem
•  Re: How to connect to oracle using java
•  Javascript code please
•  Re: open excel file in html page
•  Help! Z-index problem with iframe and dropdown menu
•  Re: SQL Date


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009