Write a program to create a file named numbersdat then


Write a program to create a file named "numbers.dat". Then create an algorithm that adds all even numbered integers from 1 to 100, separated by a comma. After the file has been created, close and reopen the file and display the results to the screen. After the results have been displayed append the odd number integers from 1 to 100, separated by a comma to the end of the file. Reopen the file, and display the results.

TIP:

The output would look like this:

2, 6, 12, 20, 30, 42, ....
2, 6, 12, 20, 30, 42, ....
1, 4, 9, 16, 25, 36, .....

Because you output even numbers.
Close file.
Open, read and write to the screen.
Then close file.
Open for writing.
Append the odd numbers.
Close file.
open, read and write to screen.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program to create a file named numbersdat then
Reference No:- TGS01250212

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)