Instructor: Todd Dole
This assignment gives practice writing a file.
Prompt the user for the name of a file to create, and the number of random numbers to generate.
Then, generate the specified number of random numbers, using Math.random()*1000.0
Write each number to the file specified, with one number per line.
Be sure to close the file when finished, and print a message letting the user know the file has been created.
Include a try/catch block to catch any errors and display an appropriate message.
Example input:
Please enter the name of the file you want to create: numbers.txt
How many random numbers do you want? 100
File numbers.txt created
This example would create a file called numbers.txt containing 100 random numbers.