Question: Write a Java program that asks the user to enter two file names. The first file is the same one you created in Question 1
Write a Java program that asks the user to enter two file names. The first file is the same one you created in Question 1 and should be opened for reading. The second file should be opened for writing. The program will read the contents of the first file, change the characters of the odd line numbers to uppercase, and store the results in the second files.
Notes:
- The second file will be a copy of the first file, except that all the characters of the odd-numbered lines will be uppercase.
- The String class in Java has a methode named toUpperCase(), you can use it to convert lower case to upper case strings.
Question 3:
Write a program that will write 5000 random integers in the range 0-1000 to a file named RandomNumbers.txt. Then, the program will read this file and do the following:
- Write the even number to a new file named EvenNumbers.txt
- Write the odd number to a new file named OddNumbers.txt
- Write the following statistics to a new file named Stats.txt
- Number of even values
- Number of odd values
Step by Step Solution
3.42 Rating (146 Votes )
There are 3 Steps involved in it
Question 1 Here is a Java program that reads a file changes the characters of the odd line numbers to uppercase and writes the result to a new file import javaio public class FileManipulation public s... View full answer
Get step-by-step solutions from verified subject matter experts
