Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download: http://solutionzip.com/downloads/textfileio-java/
- Quick TextFileIO.java program to create a file named numbers.dat.
- Then create an algorithm that writes 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.
- The contents of the file should be the even numbers from 1 to 100
- separated by a comma
- followed by the odd number from 1 to 100 separated by a comma.
- The output of this program would be something like the following:
- 2,4,6,8,10,12,14,……,98,100
- 2,4,6,8,10,12,14,……,98,100,1,3,5,7,9,……..97,99
- The file processing program does not need to be a GUI
- application.
- Building a GUI for this program is optional.
- You should follow the description of each assignment described
- under
- the iLab and the items listed in the grading rubric when building
- your programs.
- You want to make sure you are meeting the requirements.
- This program does not require user input.
- Follow exactly what the description states:
- 1. You will write a Java program that will generate a file called
- number.dat
- 2. In this file you will store all even integers from 1 to 100
- (NOT THE SUM of these numbers, please), separated by a comma;
- close the file.
- 3. Reopen the file and display the contents of the file; even
- numbers from 1 to 100 will display
- 4. After the results have been displayed append the odd integers
- from 1 to 100 (again,
- NOT THE SUM of these numbers, please), separated by a comma to
- the end of the file.
- 5. Reopen the file, and display the results. This second output
- should display a line containing
- the even numbers separated by comma followed by the odd numbers
- separated by comma. For example:
- Output of your program:
- 2, 4, 6, 8,…., 100
- 2, 4, 6, 8,…., 100, 1, 3, 5,…,99
- *********/
- Download: http://solutionzip.com/downloads/textfileio-java/
Advertisement
Add Comment
Please, Sign In to add comment