P
picaza
hi,
i am trying to learn java and i am sitting in on a couple of classes at
my alma...(btw: i am not a for credit student so these q's are not to
get out of homework). this seemingly simple point has me stuck. i want
to write out several "doubles" to a file such that they appear as
char/string. i have tried various castings to no avail. here is the
latest code i have. any hints?
also i can use any dev tool i wish and i choose eclipse because it seems
to be well used in the job market. would you concur that eclipse is the
best ide to use?
thanks,
peter, unemployeed UNIX/C guy
+++++++++++++++++++++++++++
public void GenerateRamdomDoubleNumbers(int howMany, String fName)
{
File outFile = new File(fName);
Double number;
FileWriter fw = new FileWriter(outFile);
try
{
for (int x = 0; x<howMany; x++)
{
number = (Double)( 1 + (Math.random() * howMany) );
fw.write((number.toString()) );
}
}
catch ( IOException e)
{
}
}
i am trying to learn java and i am sitting in on a couple of classes at
my alma...(btw: i am not a for credit student so these q's are not to
get out of homework). this seemingly simple point has me stuck. i want
to write out several "doubles" to a file such that they appear as
char/string. i have tried various castings to no avail. here is the
latest code i have. any hints?
also i can use any dev tool i wish and i choose eclipse because it seems
to be well used in the job market. would you concur that eclipse is the
best ide to use?
thanks,
peter, unemployeed UNIX/C guy
+++++++++++++++++++++++++++
public void GenerateRamdomDoubleNumbers(int howMany, String fName)
{
File outFile = new File(fName);
Double number;
FileWriter fw = new FileWriter(outFile);
try
{
for (int x = 0; x<howMany; x++)
{
number = (Double)( 1 + (Math.random() * howMany) );
fw.write((number.toString()) );
}
}
catch ( IOException e)
{
}
}