Write a Java program that asks the user to enter two file names. The first file is
Fantastic news! We've Found the answer you've been seeking!
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 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
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date: